Apr 20
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:
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:
...
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.
May 5, 2007 at 5:44 PM Excellent information!
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/..."
May 6, 2007 at 5:51 AM Thanks for the info Marcus. I did a quick search and could only find a Korean armory site for the other location specific WoW sites - http://armory.worldofwarcraft.co.kr
Jun 13, 2007 at 5:24 PM I was just wondering, do you have an email address I could contact you at? I have a couple of questions regarding this blog post.
Jun 14, 2007 at 4:39 AM Yes, shooksm at hotmail.
Jul 16, 2007 at 8:00 AM Hey there!
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
Jul 22, 2007 at 9:15 PM @maic
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.
Apr 19, 2008 at 3:03 AM Have you found a way to use cfhttp to login to the armory and allow coldfusion to parse the guild bank and guild log xml docs.
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.
Apr 20, 2008 at 6:06 PM Sweet, thanks alot for giving it a try. My guildies will be quite impressed if I can add bank data to the site as well as everything else. I really wish I could figure it out, but every attempt I've made has given me errors and I just don't have the time to mess around with it right now.
I'm looking forward to seeing your results!!
Thanks again.
Jan 15, 2009 at 1:10 AM Hi - I have been trying to do this with the following code:
<cfhttp method="get" url="http://eu.wowarmory.com/character-sheet.xml?r=Lightbringer&n=Yusuki" useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2" resolveurl="yes"></cfhttp>
<cfset xmlDoc = cfhttp.FileContent>
<cfoutput>#xmlDoc#</cfoutput>
to see if it is working but I just get a blank page - nothing in it. I have tried several options but to no avail.
WHat do you see when you get the info ?