![]() |
World of Warcraft Armory xml Grabber with cURL
Ok, I ran across this a little while ago and since I spent a lot of time looking for this, I thought I would share this with all you guys here that want it.
PHP Code:
PHP Code:
Another example (to get the name): PHP Code:
All simple stuff but it helped me out. The World of Warcraft Armory - EU The World of Warcraft Armory - US |
Thanks, I wrote something similar not long ago for a guild website i was developing. In my case I used armory to populate the guild roster in the DB.
One thing i did notice about your code: PHP Code:
This is the correct code: PHP Code:
PHP Code:
PHP Code:
|
Thanks, updated it.
|
Looks cool :D
|
Pretty good, but I don't play WoW. ;) Non the less, good share.
|
Great contribution, really simple to follow and takes a whole lot of headache out of querying the armory!
Managed to get information on characters with no problems but hit a snag when trying to query guild info. Noticed a wee typo on the example above: PHP Code:
Remove the spurious .com and everything works as expected :) p.s excuse the thread necromancy ... figured this was worth it though. |
Just also noticed, for guilds or server names with spaces the above code breaks. This very slightly modified version should be fine as it converts the whitespace to '+' which is how blizz formats it.
PHP Code:
|
Cheers :-)
|
Ok quick question for you PHP folks. :)
I have managed to get this "working" for a guild roster. I get to this point... PHP Code:
My question is, how do you look through all of the character elements of the members element to get the information on each character? My PHP skills aren't the best in the world, sorry if this is a dumb question! Thanks in advance for any help! |
Ok I figured it out (should have googled first haha!)
PHP Code:
Anyone know how I can go about sorting this array of arrays for the ['name']? |
It doesnt work for me.
Quote:
|
Welcome to the community, Kalle! In order for it to work, you will need to have the cURL module enabled on your server.
To do so, open the following file: C:\wamp\Apache2\bin\php.ini and uncomment the line extension=php_curl.dll (Remove the semi-colon from the start of the line). Don't forget to restart WAMP after doing so. |
An alternative to using curl would be:
PHP Code:
|
This is great. I'm slowly working with it to get what I needed but I'm having a problem.
I love the roster and able to pull information from that to create a guild roster. The issue I'm having is I also want to parse in the Profession information. However that is on the separate character pages themselves. How can I grab both roster and all the character pages from that one guild roster so I can then display them how I want. You can see what I've sort of been experimenting with here: http://wow.guildregister.com/sortableTable/roster.php Or even better due to Armory not updating as much. How could I get a .lua file converted over to XML or some format so I can work with it, similar to what you've done with the Armory page. That would work best since that includes officer notes, guild notes, professions, names, etc. Example of .lua file is here: http://wow.guildregister.com/sortabl...erProfiler.lua |
have a look at this:
http://fin.instinct.org/lua/ |
Unfortunately that doesn't work for me. So continuing to work with what he has done here I have...
I can then sort the xml data and have it display information in a table format (still work in progress) just by adding this to the code: Code:
$armory = new armory('roster', 'Drenden', 'Priests of Discord', NULL, NULL);Code:
$armory = new armory('roster', 'Drenden', 'Priests of Discord', NULL, NULL);The problem is the 'character' xml page. There is a lot more information in that page. I could access it for a single character like 'Anastasia' by using the following code: Code:
$armory = new armory('character', 'Drenden', 'Priests of Discord', 'Anastasia', NULL);Load Armory Roster Page Code:
$armory = new armory('roster', 'Drenden', 'Priests of Discord', NULL, NULL);Code:
foreach ($xml->guildInfo->guild->members->character as $char) {Full Code: Code:
<?php |
it is work
add $server = ereg_replace(' ', '+', $server); |
Hey I'm trying this script and it's working great so far. but what line do I need to write to navigate into and display the values of each primary profession
example: Profession 1 name skill#/maxskill# Profession 2 name skill#/maxskill# I see that there is an "@attributes" in several lines of the entire dump but I dont know how to use PHP Code:
Any help would be appreciated. |
try this:
PHP Code:
|
Ahh I see, didn't think of the foreach function. I also tried it on the equipment. Thanks for the help. Looks nice as well. Haven't skinned it yet but this is what I got so far.
http://hellfireclub.org/testprofile.php?name=Haiasi Rather than set a predefined character to show, I modified the code to use $_GET to retrieve the name of the character so any character can be viewed. PHP Code:
"pagenamehere.php?name=charactername" Also, you can do the same for the realm to leave it open for anything PHP Code:
"pagenamehere.php?realm=realmname&name=charactername" I'm a little newbish at php so if I made a mistake, please go easy on me lol. |
| All times are GMT. The time now is 12:08 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0