ID:294962
 
Keywords: format, output, xml
Applies to:Website
Status: Open

Issue hasn't been assigned a status value.
Would be pretty nice if we could output the format as xml.

http://www.byond.com/games/Exadv1/SpaceStation13?format=xml instead of http://www.byond.com/games/Exadv1/SpaceStation13?format=text

Example:

<gameinfo>
<type>game</type>
<title>Space Station 13</title>
<path>Exadv1.SpaceStation13</path>
<shortdesc>"Stay alive inside Space Station 13</shortdesc>
<longdesc>See <a href=\"http://ss13.donglabs.com/index.php?title=Main_Page\">http://ss13.donglabs.com/index.php?title=Main_Page</a><br>\n<br>\nCommenting has been turned off since developers do not generally read HUB comments. Please, take all grievances, suggestions, etc. to the forum/forum thread of the SS13 version you are currently enjoying!</longdesc>
<author>Exadv1</author>
<version>13</version>
<banner>http://www.byond.com/games/banners/8266.png</banner>
<icon>http://www.byond.com/games/hubicon/8266.png</icon>
<smallicon>http://www.byond.com/games/hubicon/8266_s.png</smallicon>
<multiplayer>1</multiplayer>
<date>02/16/03</date>
<lastupdate>03/26/11</lastupdate>
<lastplayed>02/10/12</lastplayed>
<listing>1</listing>
<tags>action, rpg, scifi</tags>
<fans>2799</fans>
<screenshots>0</screenshots>
<video>http://www.youtube.com/watch?v=7M-JPH5SOmI</video>
</gameinfo>

<world1>
<url>byond://BYOND.world.1371241286</url>
<version>488</version>
<status><b>\[US] Gibbed #3</b> &#8212; <b>Transport Base 28</b> (<a href=\"http://ss13.lljk.net/\">Goon Station 13</a> r8056): secret, AI allowed, ~81 players, hosted by <b>Galactic Order of Oppressive Neckbeards</b></status>
<players>Atomic1fire,Damilola,Ter Tang,Operation0,Drone_Fragger,Nautilus42,Karina404,Asterisk8,HipBEE,Gri3ver,Verelia[...]</players>
</world1>


As far i know this can be easily done with Javascript. I would really love to see this.

This Could work. http://www.webhosting.uk.com/forums/ web-designing-development/ 7945-xmlwriter-simple-javascript-xml-creator.html
What other formats are available other than text either way?
Kind of pointless in having an entire 'format' parameter, if text is the only option.
We could have another formats, though.

PS: Added example. :o
I'd like either of the two examples shown here.

The first is a PHP print_r() of the hub info. The second is a PHP serialize()d version of the first example. Either one would give me the same result (not needing to do it myself, as seen in creating the examples).

I can see format=php_array and format=php_serialze being very popular. As the hub offers such a lovely way to conveniently and easily grab server info.
Seems interesing that way too.
Definitely at least XML and JSON. Tom mentions the possibility of adding XML here: http://www.byond.com/forum/?post=211064#comment972664
I would really love to see this, i have a few ideas that could improve stuff. :P
XML and JSON seem reasonable. I don't know why the site should cater to PHP, which can easily parse both XML and JSON.
That's true Airjoe. It's also capable of parsing the hub page in text format, as seen in the aforementioned example. Yet, here I am.
With the current savefile text format, you're parsing it using your own function that may have only been tested in a handful of cases and could possible be vulnerable to CSRF or XSS vulnerabilities. You are literally reading and presenting data from another website that you don't control. Obviously, this leaves something to be desired in the current machine readable hub pages.

The difference is that when parsing XML, you're using a native, stable, tested function that is completely meant for reading a certain data format and presenting it in [your favorite language here]. Once you have this, I'm not sure why you wouldn't simply use the PHP XML Parser to give you whatever PHP friendly array you'd like, if it's not already in one by default.

To me, it doesn't seem like creating a special format for one particular language makes sense from a resource utilization standpoint, especially since the BYOND website isn't written in PHP which means whoever implements this is would have to research exactly how to format and present a PHP array, serialized or not. There are ten pages of unresolved bug reports and sixteen pages of unresolved feature requests, do you think this is a reasonable request for the developers to spend their time on?
Any idea if this would be done?
http://awesomeware.org:8080/ProxyServices/rest/developer/ Stephen001/EventScheduling

Just an example, only works on developer resources, and only sub-set of fields is supported. If you send an Accept: application/json header in your GET request, it'll return JSON instead of XML.

It's essentially a proxy service.
I've actually extended it to games now, although there's still some stuff missing:

http://awesomeware.org:8080/ProxyServices/rest/games/Exadv1/ SpaceStation13
Looks nice, imo! :)
Cheers! I think it'll be quite handy for separate websites for your game, where you want to list up your game's servers.
Altered the URL slightly, note the lowercase proxyservices

http://awesomeware.org:8080/proxyservices/rest/developer/ Stephen001/EventScheduling
So, how's this going?
I like this suggestion, but if JSON were to be added, could JSONP be supported as well for the sake of cross-domain AJAX calls?
In response to Blastcore (#16)
It was never spoken uppon adding. So probably not going at all.
Note that Stephen's proxy is running just fine and works...
Page: 1 2