Previously, I wrote (mostly via control-V) javascript for converting the XML to javascript arrays.
Shortly thereafter, a comment on the DR forums suggested a better idea.
What would be cool is if the DR devs would provide an alternate output in json. It sure would make consuming the data easier than parsing xml.
Now I immediately assumed there’d already be an XML to JSON converter available in PHP. Then I eventually discovered that there was not, and given PHP5’s built-in capabilities, the odds of there ever being one were slim.
Bad news for me, stuck with PHP4 on Yahoo! Web Hosting.
Good news for me was finding an XML2Array PHP function as well as a Array2JSON PHP function elsewhere. All that I needed to do was to bring them together.
So I did.
If you are looking for Dungeon Runners character data in JSON format, there it is. You’ll want to change ‘anson’ to the name of the DR character whose data you’d like.
The problem with the above link, of course, is that it’s not “official” character data straight from dungeonrunners.com. For that you’ll need my PHP files, and a server of your own to run them.
Another problem with the above, is that it only converts DR character data, whereas you may be in a PHP4 XML hell of your own.
To address both issues, I will post my source files for the above. Feel free to run-off with the stuff I found on the internet.