 |
Account Login
|
 |
 |
Latest Articles
|
 |
 |
IRC Channel
|
 |
 |
Associates
|
 |
 |
Associates
|
 |
|
 |
|
 |
|
 |
04-23-2009, 10:29 AM
|
#101 (permalink)
|
|
The Visitor
Join Date: Apr 2009
Posts: 3
Thanks: 2
|
I don't know what I did, but it works now. I wonder why the race and class options don't display? And also, is there a way to have it sort by rank?
Cheers!
|
|
|
|
04-23-2009, 06:16 PM
|
#102 (permalink)
|
|
The Visitor
Join Date: Apr 2009
Posts: 2
Thanks: 2
|
I'm not sure if it's just me but I have been having problems with special letters that people use in their names such as "ë" ... sometimes they get displayed as random garbage, is there any fix for this? is there even anyone else thats seen this happen? and to Crispus they changed the Armory xml and it only has class ID's now no more Classes, heres the id to class list
1 = warrior
2 = paladin
3 = hunter
4 = rogue
5 = priest
6 = dk
7 = shaman
8 = mage
9 = warlock
11 = druid
and id to race list
1 = human
2 = orc
3 = dwarf
4 = night elf
5 = undead
6 = tauren
7 = gnome
8 = troll
10 = blood elf
11 = draenei
Last edited by argantes : 04-24-2009 at 06:03 PM.
|
|
|
|
04-24-2009, 08:51 PM
|
#103 (permalink)
|
|
The Visitor
Join Date: Apr 2009
Posts: 1
Thanks: 2
|
Hi! I was looking for nice system to get data from armory and I found this place and nice simple examples. I used before patch and few times after patch but now I just get this..
SimpleXMLElement Object ( [@attributes] => Array ( [globalSearch] => 1 [lang] => en_us ) [errorhtml] => SimpleXMLElement Object ( ) [comment] => SimpleXMLElement Object ( ) )
Is it possible that they limit amount you get data or how much you can use their bandwith? It worked again this morning but when i did few search it started to give: failed to open stream: HTTP request failed! HTTP/1.1 503 Service Temporarily Unavailable.
I was planning to make system which find all my guild members and then make simcarft file each of my guild member.
http://code.google.com/p/simulationcraft/
Last edited by miica : 04-25-2009 at 09:28 AM.
|
|
|
|
04-25-2009, 07:47 PM
|
#104 (permalink)
|
|
The Wanderer
Join Date: Feb 2009
Posts: 11
Thanks: 2
|
Quote:
Originally Posted by argantes
I'm not sure if it's just me but I have been having problems with special letters that people use in their names such as "ë" ... sometimes they get displayed as random garbage, is there any fix for this? is there even anyone else thats seen this happen? and to Crispus they changed the Armory xml and it only has class ID's now no more Classes, heres the id to class list
1 = warrior
2 = paladin
3 = hunter
4 = rogue
5 = priest
6 = dk
7 = shaman
8 = mage
9 = warlock
11 = druid
and id to race list
1 = human
2 = orc
3 = dwarf
4 = night elf
5 = undead
6 = tauren
7 = gnome
8 = troll
10 = blood elf
11 = draenei
|
Use UTF-8 encoding, special characters will show then.
http://www.resistance-guild.eu/members.php
|
|
|
|
|
The Following User Says Thank You to Yinx For This Useful Post:
|
|
04-25-2009, 10:11 PM
|
#105 (permalink)
|
|
The Visitor
Join Date: Apr 2009
Posts: 3
Thanks: 2
|
Quote:
Originally Posted by argantes
I'm not sure if it's just me but I have been having problems with special letters that people use in their names such as "ë" ... sometimes they get displayed as random garbage, is there any fix for this? is there even anyone else thats seen this happen? and to Crispus they changed the Armory xml and it only has class ID's now no more Classes, heres the id to class list
1 = warrior
2 = paladin
3 = hunter
4 = rogue
5 = priest
6 = dk
7 = shaman
8 = mage
9 = warlock
11 = druid
and id to race list
1 = human
2 = orc
3 = dwarf
4 = night elf
5 = undead
6 = tauren
7 = gnome
8 = troll
10 = blood elf
11 = draenei
|
Thanks alot. How would you go about converting the numeric value into said class?
|
|
|
|
04-27-2009, 08:59 PM
|
#106 (permalink)
|
|
The Visitor
Join Date: Apr 2009
Posts: 2
Thanks: 2
|
Quote:
Originally Posted by crispus
Thanks alot. How would you go about converting the numeric value into said class?
|
i use 2 functions i wrote
PHP Code:
function return_class($classid) {
switch ($classid) {
case 1:
$class = "Warrior";
break;
case 2:
$class = "Paladin";
break;
case 3:
$class = "Hunter";
break;
case 4:
$class = "Rogue";
break;
case 5:
$class = "Priest";
break;
case 6:
$class = "Death Knight";
break;
case 7:
$class = "Shaman";
break;
case 8:
$class = "Mage";
break;
case 9:
$class = "Warlock";
break;
case 11:
$class = "Druid";
break;
}
return $class;
}
called like
PHP Code:
$toonclass = return_class($char['classId']);
and for race
PHP Code:
function return_race($raceid, $sex) {
switch ($raceid) {
case 1:
if ($sex == "0") {$race = "Human Male";}
if ($sex == "1") {$race = "Human Female";}
break;
case 2:
if ($sex == "0") {$race = "Orc Male";}
if ($sex == "1") {$race = "Orc Female";}
break;
case 3:
if ($sex == "0") {$race = "Dwarf Male";}
if ($sex == "1") {$race = "Dwarf Female";}
break;
case 4:
if ($sex == "0") {$race = "Night Elf Male";}
if ($sex == "1") {$race = "Night Elf Female";}
break;
case 5:
if ($sex == "0") {$race = "Undead Male";}
if ($sex == "1") {$race = "Undead Female";}
break;
case 6:
if ($sex == "0") {$race = "Tauren Male";}
if ($sex == "1") {$race = "Tauren Female";}
break;
case 7:
if ($sex == "0") {$race = "Gnome Male";}
if ($sex == "1") {$race = "Gnome Female";}
break;
case 8:
if ($sex == "0") {$race = "Troll Male";}
if ($sex == "1") {$race = "Troll Female";}
break;
case 10:
if ($sex == "0") {$race = "Blood Elf Male";}
if ($sex == "1") {$race = "Blood Elf Female";}
break;
case 11:
if ($sex == "0") {$race = "Draenei Male";}
if ($sex == "1") {$race = "Draenei Female";}
break;
}
return $race;
}
called with something like
PHP Code:
$toonrace = return_race($char['raceId'], $char['genderId']);
|
|
|
|
|
The Following User Says Thank You to argantes For This Useful Post:
|
|
04-30-2009, 01:06 AM
|
#107 (permalink)
|
|
The Visitor
Join Date: Apr 2009
Posts: 1
Thanks: 0
|
Further information from armory
I would like to thank all of the contributors to this thread. It took me a little while to get my head around all of this and for my coding skills to come back to me with lack of sleep and lots of coffee. I have used code from various posters and all credit goes to those that I have pulled code from.
I was looking for a way to display a guild list that included all of the pertinent information that any guildy would want to know about their online raid friends. The first bit was getting the list together and then pulling together information from further Blizz xml pages.
For actual raiders, they are obviously only going to be top level and usually of a certain rank within the guild. My listing will only show players of level 80 and rank 5 and above. I separated the mappings for rank/class/race etc in the event that you wanted a public and private list that displayed different information. You may not want public to see the professions, specs and so on for all of your guild members.
The layout is somewhat messy and busy but the functionality is there and it just needs some tlc on the layout through css or whatever your pleasure.
Although this lies outside the scope of this thread and perhaps the forum, this current setup I have is only a short term solution until I can put together a lighter weight version running xml/xsl but this is a little ways off yet but will be much cleaner when I work out how to do it. I want to compile pertinent information from multiple Blizz xml into another xml file basically and go from there.
This is what I have come up with - please feel free to comment or give me any tips.
*IMPORTANT*
As this code will create multiple queries for the final output, a large improperly filtered roster list can take some time to display as it will pull an extra xml file for each character in the roster that is not being filtered out. Take note for the character level and guild ranking filters that are in place so you don't end up with a supersized list. My guild has 92 members but the final list that displays is only 39 actual rostered raiders that are not alts etc. This list takes a few seconds to populate depending on your connection speed.
roster_functions.php:
PHP Code:
<?php
/*
return_class Returns the acutal class name for a character
return_rank Returns a rank mapping as this information is not held on the Armory
return_race Returns Race and Sex information
*/
static $browser_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";
function return_class($classid) {
switch ($classid) {
case 1:
$class = "Warrior";
break;
case 2:
$class = "Paladin";
break;
case 3:
$class = "Hunter";
break;
case 4:
$class = "Rogue";
break;
case 5:
$class = "Priest";
break;
case 6:
$class = "Death Knight";
break;
case 7:
$class = "Shaman";
break;
case 8:
$class = "Mage";
break;
case 9:
$class = "Warlock";
break;
case 11:
$class = "Druid";
break;
}
return $class;
}
function return_rank($rankid) { // Adjust the names here for the guild rank names. 0 is always the Guild owner
switch ($rankid) {
case 0:
$class = "Guild Manager";
break;
case 1:
$class = "Guild Manager";
break;
case 2:
$class = "Bank Access";
break;
case 3:
$class = "Advisor";
break;
case 4:
$class = "Raider";
break;
case 5:
$class = "Member";
break;
case 6:
$class = "Recruit";
break;
case 7:
$class = "Alt";
break;
}
return $class;
}
function return_race($raceid, $sex) {
switch ($raceid) {
case 1:
if ($sex == "0") {$race = "Human Male";}
if ($sex == "1") {$race = "Human Female";}
break;
case 2:
if ($sex == "0") {$race = "Orc Male";}
if ($sex == "1") {$race = "Orc Female";}
break;
case 3:
if ($sex == "0") {$race = "Dwarf Male";}
if ($sex == "1") {$race = "Dwarf Female";}
break;
case 4:
if ($sex == "0") {$race = "Night Elf Male";}
if ($sex == "1") {$race = "Night Elf Female";}
break;
case 5:
if ($sex == "0") {$race = "Undead Male";}
if ($sex == "1") {$race = "Undead Female";}
break;
case 6:
if ($sex == "0") {$race = "Tauren Male";}
if ($sex == "1") {$race = "Tauren Female";}
break;
case 7:
if ($sex == "0") {$race = "Gnome Male";}
if ($sex == "1") {$race = "Gnome Female";}
break;
case 8:
if ($sex == "0") {$race = "Troll Male";}
if ($sex == "1") {$race = "Troll Female";}
break;
case 10:
if ($sex == "0") {$race = "Blood Elf Male";}
if ($sex == "1") {$race = "Blood Elf Female";}
break;
case 11:
if ($sex == "0") {$race = "Draenei Male";}
if ($sex == "1") {$race = "Draenei Female";}
break;
}
return $race;
}
?>
and roster.php:
PHP Code:
<?php
include 'roster_functions.php';
$guildurl = 'http://eu.wowarmory.com/guild-info.xml?r=REALM&gn=GUILD';
$charurl = 'http://eu.wowarmory.com/character-sheet.xml?';
$gch = curl_init();
curl_setopt ($gch, CURLOPT_URL, $guildurl);
curl_setopt ($gch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($gch, CURLOPT_USERAGENT, $browser_user_agent);
$rosterxml = curl_exec($gch);
$guildxml = new SimpleXMLElement($rosterxml);
foreach ($guildxml->guildInfo->guild->members->children() as $char) {
if ( $char['level'] < 80 ) continue; // Limits display to lvl 80 Chars
if ( $char['rank'] > 5 ) continue; // Limits display to active members and above (depending on your guild ranks)
$toonrace = return_race($char['raceId'], $char['genderId']); // Maps Race and Sex
$toonclass = return_class($char['classId']); // Maps class name
$toonrank = return_rank($char['rank']); // Maps guild rank name
$cch = curl_init();
curl_setopt ($cch, CURLOPT_URL, $charurl . $char['url']);
curl_setopt ($cch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($cch, CURLOPT_USERAGENT, $browser_user_agent);
$charxml = curl_exec($cch);
$detailxml = new SimpleXMLElement($charxml);
echo '<b>Name:</b> <a href="' .$charurl . $char['url'] .'" target="_blank">' . $char['name'] . '</a> '; //Includes an armory external link
echo '<b>Class:</b> ' . $toonclass . ' ';
echo '<b>Race:</b>' . $toonrace . ' ';
echo '<b>Rank:</b> ' . $toonrank .' ';
// echo '<b>Level:</b> ' . $char['level'] . ' '; // Displays char level
echo '<b>Professions: </b> ';
foreach ($detailxml->characterInfo->characterTab->professions->children() as $profession) {
// Displays all of the professions and skill levels and maximums
echo $profession['name'] . ' (' . $profession['value'] . '/' . $profession['max'] .') ';
}
echo '<b>Specs: </b> ';
foreach ($detailxml->characterInfo->characterTab->talentSpecs->children() as $spec) {
// Displays all of the specs in use and their builds and names. It is easily possible to show which one is active as well.
echo $spec['prim'] . '(' . $spec['treeOne'] . '/' . $spec['treeTwo'] . '/' . $spec['treeThree'] . ') ';
}
echo '<br>';
}
?>
|
|
|
|
|
The Following User Says Thank You to Draven21 For This Useful Post:
|
|
05-09-2009, 12:04 AM
|
#109 (permalink)
|
|
The Wanderer
Join Date: Feb 2009
Posts: 11
Thanks: 2
|
Quote:
Originally Posted by sorenwp
|
You are in it, this topic has all the piece of snippets or full code that can be used to make such a profile page.
That website just has it modified a bit and other design.
p.s. that website is still not finished, still working on a better one, especially the roster page (by using jflow kind of stuff to make it similar as wowarmory with tabs but without the need to reload the page)
|
|
|
|
|
The Following User Says Thank You to Yinx For This Useful Post:
|
|
05-09-2009, 07:24 AM
|
#110 (permalink)
|
|
The Visitor
Join Date: May 2009
Posts: 3
Thanks: 1
|
I have tryed all code in this topic.. no one work for me..
Can you slow or make me one as give me the info of: Name, lvl and main web if You will help me with this it will be nice :P
here is the link.
http://eu.wowarmory.com/character-sh...kspear&n=Tazim
|
|
|
|
05-09-2009, 09:56 AM
|
#111 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,053
Thanks: 115
|
Quote:
Originally Posted by sorenwp
|
Check 3 posts above you.
__________________
|
|
|
|
05-09-2009, 04:22 PM
|
#112 (permalink)
|
|
The Visitor
Join Date: May 2009
Posts: 3
Thanks: 1
|
damn my bad english-_-
3 posts above me slow all in guild, it work nice.
But i need a site as can slow singel character, this i can't get work
damn i'm pissed!! i have tryed like 6520 and 1 time now :(
OT any one as can danish :D ?.. i'm denmark
|
|
|
|
05-25-2009, 01:31 AM
|
#113 (permalink)
|
|
The Visitor
Join Date: May 2009
Posts: 1
Thanks: 0
|
Thank you very much for the samples. I've been via trial (and alot of error) building our roster for a new guild website, and so far I've been able to pull the information from the armory, but I'm not as familiar with php as I would like so I'm at the point where I need some pointers to places to make my roster look better.
Current: http://trilless.org/contempt/?q=roster
Its returning the results but they are currently in whatever hodge-podge order.
Can any of you point me to a place that will help me with sorting?
|
|
|
|
05-28-2009, 05:59 PM
|
#114 (permalink)
|
|
The Visitor
Join Date: May 2009
Posts: 1
Thanks: 0
|
Awesome piece of work.
I am running into weird issues.
Sometimes it works... sometimes it doesn't.
I uploaded, made my changes, didn't work.
Came back the next day, it worked without any changes.
I was just looking at it again without making any changes and pushed "refresh." Broken.
Fatal error: Call to a member function children() on a non-object in [superlongaddress] on line 17
line 17: foreach ($guildxml->guildInfo->guild->members->children() as $char) {
And sometimes it will also be an error on line 14 related to the SimpleXMLElement.
Errors change without any changes to the script.
So I'm a bit confused on why it keeps buggin out.
Once again, it looks wonderful.
Thank you.
|
|
|
|
|
The Following User Says Thank You to teafourtwo For This Useful Post:
|
|
05-31-2009, 02:34 PM
|
#115 (permalink)
|
|
The Visitor
Join Date: May 2009
Posts: 1
Thanks: 1
|
Quote:
Originally Posted by teafourtwo
Awesome piece of work.
I am running into weird issues.
Sometimes it works... sometimes it doesn't.
I uploaded, made my changes, didn't work.
Came back the next day, it worked without any changes.
I was just looking at it again without making any changes and pushed "refresh." Broken.
Fatal error: Call to a member function children() on a non-object in [superlongaddress] on line 17
line 17: foreach ($guildxml->guildInfo->guild->members->children() as $char) {
And sometimes it will also be an error on line 14 related to the SimpleXMLElement.
Errors change without any changes to the script.
So I'm a bit confused on why it keeps buggin out.
Once again, it looks wonderful.
Thank you.
|
It looks like you're having a similar problem that I've had to deal with... first, if the armory is down, say for maintenance, when you grab the data it will sometimes come back as blank or null, and then trying to do anything to it will error out. You could put a check that says: if ($charxml != '') { just before doing the SimpleXMLElement on it...
Also, it seems like the Armory has some kind of system to block repeat requests from the same address - this might be more of a problem the more hits to your page your get - some viewers might see the correct information, others may get an error or something else because Blizzard blocked the request.
I set up a cacheing system (which is still a little buggy) to try to avoid those 2 issues... you might want to try and do the same.
Good luck!
-Tim http://timsworld.nfshost.com
|
|
|
06-28-2009, 02:36 PM
|
#116 (permalink)
|
|
The Wanderer
Join Date: Jun 2009
Posts: 5
Thanks: 0
|
My WoW Armory XML Grabber Efforts
Last edited by DJRavine : 03-17-2010 at 01:10 PM.
|
|
|
|
|
The Following 2 Users Say Thank You to DJRavine For This Useful Post:
|
|
08-02-2009, 08:43 AM
|
#117 (permalink)
|
|
The Visitor
Join Date: Aug 2009
Posts: 3
Thanks: 3
|
World of Warcraft Armory xml Grabber with cURL
Hello,
I am new to the forum. I contact you because I use for my guild DJRavine the script (which I wish to thank for this great script). All works correctly on the information in your guild, but the only problem is that I'm on the European server "Marécage de Zangar" me and that guild called: "Lenwë Linwëlin". The script does not properly code the "é" and "ë" and so I find myself with a message: "ERROR: Unable to load XML file!".
I met her :
.
An part of my script :
Quote:
// SERVER AND GUILD SETTINGS
$config['server_name'] = "Marécage de Zangar"; // Name of the WoW Realm
$config['guild_name'] = "Lenwë Linwëlin"; // Name of your Guild
// SETTINGS FOR THE GENERAL WEBSITE
$config['base_filename'] = 'roster.php'; // Base script file name
$config['base_url'] = 'http://forum.lenwelinwelin.fr/test/'; // Base URL
$config['url_prefix_char'] = 'http://eu.wowarmory.com/character-sheet.xml?'; // Use for Char links
$config['url_prefix_armory'] = 'http://eu.wowarmory.com/'; // URL for the armory
// NOTE: THE BELOW DIRECTORY NEEDS TO HAVE WRITE ACCESS IN ORDER TO CACHE THE XML
$config['DIR_cache'] = 'cache/'; // Directory where the XML cache files are stored
// NOTE: THE ABOVE DIRECTORY NEEDS TO HAVE WRITE ACCESS IN ORDER TO CACHE THE XML
// SETTINGS FOR SQL STATEMENT GENERATION
$config['sql_database'] = 'guilde'; // SQL Database Name
$config['sql_table'] = 'rooster'; // SQL Table Name
[...]
|
|
|
|
|
08-03-2009, 06:15 AM
|
#118 (permalink)
|
|
The Wanderer
Join Date: Jun 2009
Posts: 5
Thanks: 0
|
Hey there,
I'll do some testing with your guild name and i'll post my results..
i have also heavily updated my script...
i'll post a newer version asap...
hopefully it will have a fix for your accented chars in the guild name... ;)
and tyvm for the kinda words... :D
PS. I'm currently trying to work out how to pull all the characters statistics...
If you goto http://www.wowarmory.com/character-s...al&gn=Threnody
and view the page source...
You will notice that only the category headers are listed...
Does anyone know if the complete character statistics can be accessed?
Maybe i can just use javascript to 'expand' each of the categories on the page one by one and then parse the data out?
any ideas or thoughts?
|
|
|
|
|
The Following User Says Thank You to DJRavine For This Useful Post:
|
|
08-03-2009, 04:43 PM
|
#119 (permalink)
|
|
The Visitor
Join Date: Aug 2009
Posts: 3
Thanks: 3
|
Hello,
Indeed I could see on your site that your rooster is really dévelloper and I tried to do as your own. If I can not do it I would spend otherwise.
I tried to change your script to encode accents but without success. In fact every time the script does not support accents.
If you can find in what encoding format are accent "é" and "ë" called me ...
For DJRavine do you think its possible to have embraced the same as your roster with your agreement and adding a link to your site?
Thank you in advance.
|
|
|
|
08-04-2009, 08:13 PM
|
#120 (permalink)
|
|
The Wanderer
Join Date: Jun 2009
Posts: 5
Thanks: 0
|
Hey mate,
All the accents can be stored in UTF-8 charset...
I have setup my database to store in UTF-8 and my websites display in UTF-8, This allows the characters to be displayed properly... ;)
I have now fixed my script to handle accents in the guild name and server name...
But there is still one major issue i have to sort out...
I'll let you know more soon...
|
|
|
|
|
The Following User Says Thank You to DJRavine For This Useful Post:
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|