Pulling World of Warcraft Armory data with Coldfusion
I help run my World of Warcraft guild site for my guild Redeemed. Recently I have added several pages that pull data from the newly available World of Warcraft Armory site. The Armory lists information about guilds including detailed character sheets. Over the next couple entries, I plan to show how to make use of some of that data with Coldfusion. This article will focus on where the data resides.
Previously I had used Allakhazam as our data source for the roster but had always found it lacking in accurate data as it was dependent on our guildies updating their own profiles. And with all the keyloggers trying to capture accounts, alot of our members were understandably hesitant to use it. So when the Armory came out I dug into the pages to see how it worked and was pleased to find that all pages are XML based. Browsing to a page in the Armory you will get a page like:
http://armory.worldofwarcraft.com/#character-sheet.xml?r=Stonemaul&n=Sandric
Upon viewing the source, you will notice not much is there:
<?xml-stylesheet type="text/xsl" href="/layout/pageIndex.xsl"?>
<page globalSearch="1" lang="en_us" requestUrl="/index.xml" type="front">
<pageIndex>
<related-info/>
</pageIndex>
</page>
But taking that same URL and getting rid of the # sign:
http://armory.worldofwarcraft.com/#character-sheet.xml?r=Stonemaul&n=Sandric
reveals the data behind the page:
<?xml-stylesheet type="text/xsl" href="/layout/character-sheet.xsl"?>
<page globalSearch="1" lang="en_us" requestUrl="/character-sheet.xml">
<characterInfo>
<character battleGroup="Cyclone" charUrl="r=Stonemaul&n=Sandric" class="Paladin" .../>
<characterTab>
<talentSpec treeOne="0" treeThree="12" treeTwo="49"/>
<buffs>...
I started by building a couple of simple tables to hold the guild data and some player stats that I wanted for our pages. With the database created, I created a Coldfusion page to bring down the data and noticed something right away when I ran the following line:
The Armory server gave me a down level browser page with all the XML rendered as standard HTML. Having prior experience with a smart web page giving me a down level page instead of XML, I quickly appended the USERAGENT attribute giving it my Firefox useragent info:
Now all that was left was to pass the XML to be parsed so I could start using it to insert data into my database.

Since I live in Sweden I have to browse the European armory, but it's just matter of editing the URL:
"http://armory.wow-europe.com/..." instead of "http://armory.worldofwarcraft.com/..."
I've been able to successfuly pull any data from the armory through the xml files in my local testings, BUT now I'm having problems beacuse when I upload it to a server, I have to use a proxy to been able to access it, and I've found that through it, the xml petitions return the xml file already rendered as HTML (as you stated).
I'm not using firefox, I'm using IE7, so how should I make it to been able to get the xml data instead the rendered html data?
Thank you SO much for your help
Your code that gets the XML from the Armory has to do it using a user agent of a modern browser. Otherwise the armory will assume the browser accessing the page is a downlevel browser and return the XML as rendered HTML instead. Most HTTP objects have a way of setting the user agent directly, just need to check the documentation on how to do it.
I am pretty proficient in Coldfusion but have never attempted to simulate an authenticated session before. Basically I just want to be able to display my Guild Bank and Guild Log data on my Coldfusion hosted guild site.
I'm looking forward to seeing your results!!
Thanks again.