Code and stuff

Posted by Simes at 9:30 pm

This is the repository for neat stuff I write and share with the world.

XBox Live Gamercard parser

The first item is an Xbox Live Gamercard parser in php. I wrote this because I wanted to be able to do some dynamically-generated images for forum signatures containing the gamercard info, e.g. gamerscore, reputation stars etc.

The getGamerCard() function retrieves the html for the gamercard from the Xbox Live site, removes some non-xml-compliant tags, and parses the information out using XPath queries. It’s then stored in a gamercard object and returned to the caller to do with as they see fit. Simple, but effective.

Requires allow_url_fopen (or replacement HTTP download code) and the domxml extension.

21/06/2006: MS added a SCRIPT tag to the gamercard HTML which broke the parser. Updated the code to handle this.

2 Responses to “Code and stuff”

  1. [...] Code And Stuff I’ve chucked a new permanent page on the site, Code and Stuff, which will have any neat snippets of code I write and feel like sharing with the world. First [...]

  2. [...] A new entry on the Code and Stuff page – exports iTunes playlists to .M3U equivalents. Handy for XBox 360 owners who use media connect but want to manage their custom playlists in iTunes [...]

© 2011 simes dot org Suffusion theme by Sayontan Sinha