Xbox Live XML feed
1:38pm on March 28th, 2009
As part of my new WordPress theme, I’ve added a basic Xbox Live XML feed processor; it’s basically doing the following:
- A PHP script running via a cron job (outside of my web directory) grabs an Xbox Live XML data feed from Duncan Mackenzie’s site (my raw feed).
- I then extract the few bits of data I want to keep using the in-built PHP SimpleXML extension, (I’m just grabbing my Gamerscore and status info for the moment) and then dumps it into a MySQL database.
- The WordPress front-end will then query the database on each page load rather than hammering the raw feed directly (this should hopefully save Duncan some bandwidth, plus if the feed ever falls over, I’ve still got some usable data kicking around).
- The cron job runs every 30 minutes or so (it was running every 2hrs or so while testing) – if the last update time is over 30mins then there’s something dodgy with the feed. Oh yeah, I’m using cPanel 11, which makes setting up a cron job to run a PHP script a breeze.
Admittedly there’s nothing very complicated going on, but getting it working without too much fuss deserves some lovely achievement points I think

In the future I’ll probably look at using some of the available game data, but this is enough to keep me going for now.