Hazeron Forums
Haxus, can we get Galactic chat exposed on an API endpoint? - Printable Version

+- Hazeron Forums (https://hazeron.com/mybb)
+-- Forum: Shores of Hazeron (https://hazeron.com/mybb/forumdisplay.php?fid=1)
+--- Forum: Cantina (https://hazeron.com/mybb/forumdisplay.php?fid=12)
+--- Thread: Haxus, can we get Galactic chat exposed on an API endpoint? (/showthread.php?tid=689)



Haxus, can we get Galactic chat exposed on an API endpoint? - CaptObvious - 05-31-2019

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!


RE: Haxus, can we get Galactic chat exposed on an API endpoint? - Deantwo - 05-31-2019

You can use http://hazeron.com/galactic.html
That was made for such, but I never got around to using it.


RE: Haxus, can we get Galactic chat exposed on an API endpoint? - CaptObvious - 05-31-2019

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.


RE: Haxus, can we get Galactic chat exposed on an API endpoint? - Deantwo - 05-31-2019

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.