Hazeron Forums

Full Version: Haxus, can we get Galactic chat exposed on an API endpoint?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey Haxus,

I was wondering if we could get Galactic chat exposed on an API endpoint?  I'd like to build a bot that would post messages sent to Galactic ingame into Discord and would rather not have to scrape the HTML from http://hazeron.com/galactic.html

It'd be *really* nice if we could get Discord be able to post back to Galactic if someone replies to the bot, but I could understand if that's a hard no.

Hey Haxus,

I was wondering if we could get Galactic chat exposed on an API endpoint?  I'd like to build a bot that would post messages sent to Galactic ingame into Discord and would rather not have to scrape the HTML from http://hazeron.com/galactic.html

It'd be *really* nice if we could get Discord be able to post back to Galactic if someone replies to the bot, but I could understand if that's a hard no.

As a suggestion, you could add http://hazeron.com/galactic.json with the same data as the HTML and have it formatted like this:


{
  "messages": [
    {
      "galaxy": "Shores of Hazeron",
      "player": "Captain Obvious",
      "message": "This is a test message.",
      "timestamp": "2019-05-31T03:07:23Z"
    },
    {
      "galaxy": "Shores of Hazeron",
      "player": "Deantwo",
      "message": "Please call me Danetwo from now on.",
      "timestamp": "2019-05-31T03:07:40Z"
    }
  ]
}

Thanks!
You can use http://hazeron.com/galactic.html
That was made for such, but I never got around to using it.
Yeah I know, it's just bad juju to parse HTML to extract data as every time the HTML changes (like if Haxus updates the site) it'll break.
I would also love a simplified version of playerson.html.
Maybe Avatars.html and AvatarsByEmpire.html too.
Could even do so for the blueprint exchange pages.