| « Extracting WoW Achievements from the armory | fuse-j for java 6 » |
Using PHP for reading the WoW Armory
I’ve been playing around with extracting data from the WoW Armory. The main problem with reading from the armory is that if you don’t specify the correct user agent the armory returns you some nicely formatted HTML. Which is fine for browsing - but if you want to extract data you’ll want the XML version.
All the examples I found to do this via PHP require the curl library to be installed - however the easier alternative is just to use file_get_contents after setting the appropriate user agent via ini_set:
PHP:
ini_set("user_agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"); | |
$xml = file_get_contents($url); |
Trackback address for this post
1 comment
Comment from: just_a_programmer [Visitor]
THANK YOU!
13/06/10 @ 12:37