My XFire “Gamercard” hack.

With Xbox Live, you can get yourself a snazzy little “gamercard” for your website/whatnot by inserting a little html. XFire has the same kindof thing with their “miniprofiles”, but i like the look of the live version better, so i did a little hackery.

XBox Live version My Xfire version

Specifics after the jump! bonus points if you know what “famous person” HiroProtagonist is. :p

I would have used my own xbox live gamercard, but i don’t have a 360, so i don’t have any interesting status to see.

I got the idea from xfire’s mini profile and seeing live’s gamercards all over the place. I like the xbox live look better than xfire’s default profiles, but i’m hoping stuff like this will make the xfire crew look at a couple little things it could do to make this easier for users. Especially since the xfire client has skinning support, why shouldn’t the mini profiles? If they turned the profile site into an xml / soap / something service, this would be super easy, and nobody would be wasting bandwidth downloading the whole profile page and parsing out stuff.

I got the code for scraping the xfire profile page from Jason Reading at He has a whole bunch of utilities there to make profiles and all kinds of cool things from your xfire data. The code that i wrote is now hosted there, since i started from Jason’s stuff.

The gamercard driven by your xfire stats from your profile page. My code uses same setup, syntax as the xbox live one does. Unlike the microsoft one, there are only links to your xfire profile and not to the games themselves, because the xfire profile site doesn’t have any info or urls for games. The icon mouseover does indicate your week/alltime playing times for each game.


XBox Live Gamercard
<iframe src="" scrolling="no" frameBorder="0" height="140" width="204"></iframe>
XFire Standard Gamercard
<iframe src="" scrolling="no" frameBorder="0" height="140" width="204"></iframe>
XFire Custom
Custom Avatar, custom link for avatar, silver style
<iframe src="" scrolling="no" frameBorder="0" height="140" width="204"></iframe>



  • xfire_card.php.
    See CXS Custom Xfire Sigs for the official source and README


  • username – xfire username


  • style – either “gold” (default) or “silver”. this goes with the gold/silver status of live members and changes the color of the top.
  • avatar – url to image to use as avatar. note that this is in a url, so special chars should be url encoded.
    the code sets this image to 64×64, so smaller images are scaled up by the browser(like your xfire standard avatar, game icons) or large images scaled down to fit.
  • css – url to cascading style sheet to use. by default, uses microsoft’s standard gamercard css. again note urlencoding
  • link – url to where you want clicks on your avatar to go.

Possible Improvements

  • Make the script output as an image. Many people have complained about live’s iframe gamercard,
    and many online solutions exist to get image versions or flash versions to embed into websites, sigs.
    This is probably pretty easy, as the background is an image in the css, all that is required is drawing the text parts.
    Images remove most hyperlinking, so that’s a downside there. I think thats why the flash versions exist.
  • Make more things clickable. right now clicking goes to your xfire profile, but externalizing the link would be trivial.
  • get xfire to publish this stuff through xml or soap or something so we don’t have to parse html. thats
    just wasting bandwidth for us AND for xfire.
  • get xfire to use bigger images for games. the 16×16’s are getting scaled up and look goofy.
    alternately, write a small script in php/etc that would smooth scale on the fly and cached the scaled versions
    alternately, get bigger/custom images for all the games, and use those instead of xfire’s

Posted in General Tagged with: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *


XBox GamerCard

Recent Flickr