Elitist Jerks
Register
Blogs
Forums


Go Back   Elitist Jerks » Public Discussion » Public Discussion

Reply
 
LinkBack Thread Tools
Old 02/16/09, 5:30 AM   #31
Tanoh
Piston Honda
 
Tanoh's Avatar
 
Undead Mage
 
Earthen Ring (EU)
Cleaned up the code and made a standalone version. Without many of the features my lib has, for example there's no caching at all in this one. But it works.

Source: APtracker.pl

Copy these two images, or draw your own (preferebly 16x16 or you have to change the source to make the tables not completly broken)

http://www.insomnia-guild.org/data/ok.png
http://www.insomnia-guild.org/data/not_done.png

It should work out of the box with a normal perl installation (at least it does on mine.)

Chances are you're not on "Earthen Ring" (EU) so edit the source and change the three variables $realm, $guild and $region to your realm, guild name and region.

The file "AP_out.html" will be created. If you move it to some other place, make sure the two .png files are in the same directory.

Last edited by Tanoh : 03/27/09 at 8:51 AM.

Offline
Reply With Quote
Old 02/16/09, 7:57 AM   #32
Furizaa
Somewhat usefull
 
Furizaa's Avatar
 
Worgen Hunter
 
Gul'dan (EU)
I got hooked up to this parser stuff (again) and wrote a new parser from scratch in PHP. It highly depends on OOP, the SPL and SimpleXml - so don't try it < PHP 5.2. It's designed to fit in a ZendFramework environment but also runs completely standalone. You are able to plugin various classes for ArmoryResolvers ( currently supported: StreamContext and untested cUrl ), CacheLayers ( Mysqli ), and ArmoryPages ( Character, CharacterAchievements ) or write your own against the provided interfaces. There are also demo clients included which should demonstrate the usage of the parser.

Source for the simple client w/o using cache or errorhandling
#
<?php
        
//Get all needed includes
        
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR 'ArmoryStream' DIRECTORY_SEPARATOR 'ArmoryStream.php';
        require_once 
dirname(__FILE__) . DIRECTORY_SEPARATOR 'ArmoryStream' DIRECTORY_SEPARATOR 'Page' DIRECTORY_SEPARATOR 'Achievements.php';

        
//Setup the StreamObject and tell it to use the european Armory data.
        
$oClient = new ArmoryStream();
        
$oClient->setLocationArmoryStream::LOCATION_EUROPE );
 
        
//Setup the PageObject. Use the Achievement page and get FeastsOfStrength of a character
        
$oCharacterPage = new ArmoryStream_Page_Achievements();
        
$oCharacterPage->setCharacter('Nnoitra')
                ->
setRealm("Gul'dan")
                ->
setCategoryArmoryStream_Page_Achievements::CATEGORY_FEASTSOFSTRENGTH );

        
//Stream data from Armory into the PageObject 
        
$oClient->streamIntoPage$oCharacterPage );
 
        
//Write the FeastsOfStrength into the HTTP-Response
        
echo "Nnoitra of Gul'dan<br />";
        foreach ( 
$oCharacterPage->Xml->category->achievement as $oAchievement ) {
                echo 
"
                        <img width='18px' height='18px' src='http://eu.wowarmory.com/wow-icons/_images/51x51/"
.$oAchievement['icon'].".jpg' />
                        "
.$oAchievement['title']."<br />
                "
;
        }
Theres also a demo for a client with errorhandling and one with enabled mysqli cache in the download package.

Client in action (shows Feasts of Strength for a character):
http://armorytest.end-game.eu/client_cached.php <-- Sorry, not working anymore after server crash.

Directory:
/ArmoryParser
  ArmoryParser.php
  Exception.php
  /Resolver
    Interface.php
    Exception.php
    StreamContext.php
    CUrl.php
  /Page
    Interface.php
    Exception.php
    Base.php
    Character.php
    Achievements.php
  /Cache
    Interface.php
    Exception.php
    Base.php
    MySqli.php
  • ArmoryParser.php The base class.
  • Resolver/StreamContext.php Classes under the Resolver directory are the real Armory parser which get the XML stream off the armory. StreamContext uses a simple but working file_get_contents(). You are able to provide your own Resolver as long it's implementing the ResolverInterface.
  • Resolver/CUrl.php This uses the code from page 1 of this thread to get the XML and is not tested since I am to dump/lazy to recompile my PHP with cUrl.
  • Page/Character.php Use an instance of this class to get characterdata from the Armory. The objects holds the request information (charname, realm, ...) and handles the result. Implement your own Armory pages by creating classes that extends Pages_Base and implements Pages_Interface.
  • Page/Achievements.php Same as above. Gets the achievementpage from the Armory.
  • cache/MySqli.php A cacheadapter that uses PHP's MySqli extension. Provide a databaseconnection and it will create it's tables itself if needed. Same here - write your own wich extends Cache_Base and implements Cache_Interface ( like MySql or Zend_Db_Table_Abstract ).

It should be really stable due the exceptionhandling (see client.php), but it's a lot of work to do - especially implement more page classes to cover the whole Armory.

I wrote this stuff for my own projects that involve the Armory, but I decided the share the code with the community. As long as there are people wo are interessted in the parser, I can provite updates. The code will elvolve during my current 'in mind' project. If someone wants to contribute, I can offer access to the SVN-Repo (at last i hope so... new to svn). I'm going to implement a public page to compare achievements for guilds with that parser and the ZendFramework in my sparetime.

Here's the source:
http://furizaa.end-game.eu/armory-parser.legacy.tar

**Update 03.10.2010**
Since this code is now over 1 year old and I'm not playing WoW anymore I can't give support on this. But in general it should still work thou.
**End Update**

Rev19: Fixed US-Armory support - for real
Rev18: Fixed US-Armory support
Rev10: First release

If you find this piece of code usefull let me know. If even its just to see what is PHP capable of with a grain of OOP.

Last edited by Furizaa : 10/03/10 at 8:07 AM. Reason: New revision 19

Germany Offline
Reply With Quote
Old 02/16/09, 9:29 AM   #33
NinJOu
Von Kaiser
 
Orc Warrior
 
Illidan (EU)
Originally Posted by Tanoh View Post
Cleaned up the code and made a standalone version. Without many of the features my lib has, for example there's no caching at all in this one. But it works.

Thanks for your work.

I also spent some of my week end on a PHP script based on what's been posted on the first page. I'm gonna clean it (too many vardump) and paste if here if anybody don't like perl :p

Offline
Reply With Quote
Old 02/17/09, 4:38 AM   #34
 arison
King Hippo
 
arison's Avatar
 
Pandaren Hunter
 
Windrunner
Originally Posted by NinJOu View Post
Hey guys,

I'm looking for an armory parser that can compare raid achievement for all my guildies. We have up to 50 active members and it would be easier if raid achievement tracking could be automated =)

Does anyone have heard of this type of parser ? Or should i just begin to write my own ?

Thx in advance=)
I've taken a python script I use for my guild and put it up on Google Code.

wow-scripts - Google Code

It produces nice reports like

http://perl.pattern.net/glory.txt.utf8

(First is a list by player, then at the bottom, a list by achievement).

Not flashy, but it works, and is reasonably extensible.

<Temerity> - Always recruiting. 12 hrs PST schedule - Valen#1972

United States Offline
Reply With Quote
Old 02/17/09, 6:40 PM   #35
Starfox
King Hippo
 
Starfox's Avatar
 
Tauren Druid
 
Destromath (EU)
Originally Posted by arison View Post
I've taken a python script I use for my guild and put it up on Google Code.

wow-scripts - Google Code

It produces nice reports like

http://perl.pattern.net/glory.txt.utf8

(First is a list by player, then at the bottom, a list by achievement).

Not flashy, but it works, and is reasonably extensible.
Oh nice, just had to edit the armory url to use the EU server and after some tries i realised that the options parser does not like 's and i have to use "s, german windows perhaps.
Thanks for that nonflashy approach

Hello.
Light the fuse.
For all my homies.
Do not run, we are your friends.
SimulationCraft Druid Guy

Austria Offline
Reply With Quote
Old 02/23/09, 6:22 PM   #36
Furizaa
Somewhat usefull
 
Furizaa's Avatar
 
Worgen Hunter
 
Gul'dan (EU)
In the last few days, i try'd hard to get a service running where you enter a guild, a server and a MetaAchievement and the service provides a nicely sorted table where you are able to compare those. It works in theory: The "CompareRequest" is saved as a job in a database and a deamon in the background fetches the achievements per character from the Armory. A little progress-page with Ajax let's you know wich queue position you got with a nicely animated progressbar.

The average fetchtime of a guild is like 10-15 seconds - and here start the problems. If more than ... like 5 guilds are in the queue, the wait time will be very long. I can bypass this by providing a short link to the user ( http://www.awesome.tld/gt66sr ) and tell him, he can come back later with the provided URL. BUT: There is also the EU Armory. The average time to fetch a guild with the EU Armory is 10 minutes due the mass amount of timeouts it produces. I currently have no solution for that.

If i request a page on the EU Armory via standart Browser, i get the page in no time


Germany Offline
Reply With Quote
Old 02/23/09, 8:47 PM   #37
winkiller
Von Kaiser
 
winkiller's Avatar
 
Orc Rogue
 
Aggramar (EU)
Originally Posted by Furizaa View Post
In the last few days, i try'd hard to get a service running where you enter a guild, a server and a MetaAchievement and the service provides a nicely sorted table where you are able to compare those. It works in theory: The "CompareRequest" is saved as a job in a database and a deamon in the background fetches the achievements per character from the Armory. A little progress-page with Ajax let's you know wich queue position you got with a nicely animated progressbar.

The average fetchtime of a guild is like 10-15 seconds - and here start the problems. If more than ... like 5 guilds are in the queue, the wait time will be very long. I can bypass this by providing a short link to the user ( http://www.awesome.tld/gt66sr ) and tell him, he can come back later with the provided URL. BUT: There is also the EU Armory. The average time to fetch a guild with the EU Armory is 10 minutes due the mass amount of timeouts it produces. I currently have no solution for that.

If i request a page on the EU Armory via standart Browser, i get the page in no time
Well, if the sourcecode was available, it would be no problem if people could run it on their own servers (It looks awesome, I'd love to have this)

As far as I know you should have 1.5s between each request, that's what I was told to avoid a 24h IP ban - I couldn't reproduce it yet though...

To your problem, I've written a little tutorial a while ago (Automated Armory Access Tutorial) where there's some info how, for example, let cURL send a "real browser" User Agent, that sometimes helps with the Armory (plain cURL often failed me).

And yes, EU armory is horrible, I can run our "Who in guild killed which boss how often" tool only at 5-7 in the morning without errors, whole day it's slooow.

Live fast. Die young. Spirit rez. Take revenge.

Germany Offline
Reply With Quote
Old 02/24/09, 4:21 AM   #38
Furizaa
Somewhat usefull
 
Furizaa's Avatar
 
Worgen Hunter
 
Gul'dan (EU)
This would be a pain in the ass to install on differend servers ( or at last for me to document how to do this ) with the background deamon and framework stuff. I will try to solve the Armory problems. If I fail i can make the source avialable anytime.

For the request i use the Zend_Http_Client library wich uses ( i guess ) fsockopen. With FireBug I was able to copy the whole Http request headers for use in the daemon, but still i get timeouts with the script where i get a clean response with my browser. It's not like the timeouts begin with the later requests - they appear from the very beginning of the fetching process.

I guess i have to prefetch the data like WoWProgress does it for a LIST ( caps indended ) of guilds.

Germany Offline
Reply With Quote
Old 02/27/09, 11:06 AM   #39
Xeres
Glass Joe
 
Tauren Hunter
 
Kult der Verdammten (EU)
Nice work guys. I'm currently trying to get the Armory Tool from mmo-champ running for parsing the armory to check the Hodir Reputation or any reputation for my guild. Modifying this looks pretty easy but I end up with tons of mysql errors which I can't explain as everythings looks setup correct in the configs for the parser as well as in XAMP. So my question is, is there any parser already out there, that can parse the XMLs for individual reputation tabs or single reputations? As I lack knowledge on the PHP part and couldn't find anything on google and various forums I end up with this posting here.

Offline
Reply With Quote
Old 02/28/09, 6:32 AM   #40
Furizaa
Somewhat usefull
 
Furizaa's Avatar
 
Worgen Hunter
 
Gul'dan (EU)
There are plenty of options listed in this thread. Even a full featured tutorial by Winkiller (Automated Armory Access Tutorial - codeschmie.de) wich i think is very good. You can boil down all the parsers to a few lines of code which manage to retrieve the XML from the Armory... and there are plenty of ways to do it - i ended up of using the Zend_Http_Client object. One of the simplest ways is to rape file_get_contents:
$pageString "http://eu.wowarmory.com/character-reputation.xml?r=Gul'dan&n=Nnoitra";

$getRequest stream_context_create( array( 
    
'http' => array(
        
'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"
    
)
) );

$xmlString file_get_contentsurlencode$pageString ) , 0$getRequest ); 
Now do whatever you want with the xmlString. Note: Using file_get_contents the xmlString appears to be empty if you try to write it to the response. Use a Php XML library or extension to load the string and process it further - or use cURL.

Germany Offline
Reply With Quote
Old 03/06/09, 1:34 PM   #41
Zimeron
Cookies!
 
Zimeron's Avatar
 
Finala
Night Elf Druid
 
No WoW Account
This is something I made a while back, that tracks the top achievers on my server (Kargath - US).

It's pretty crude, but it gets the job done. I have an automated check to scan every guild listed in the db as well as nonguilded people.

Achievement Tracking

United States Offline
Reply With Quote
Old 03/07/09, 6:32 PM   #42
StarletRox
Glass Joe
 
Orc Hunter
 
Shattered Hand (EU)
Originally Posted by zimeron View Post
This is something I made a while back, that tracks the top achievers on my server (Kargath - US).

It's pretty crude, but it gets the job done. I have an automated check to scan every guild listed in the db as well as nonguilded people.

Achievement Tracking
World of Warcraft Achievement Ranking | SK Gaming

Offline
Reply With Quote
Old 03/08/09, 3:53 AM   #43
inktomi
Von Kaiser
 
Pandaren Priest
 
<irL>
Ner'zhul
I've been working on my own little side project that ranks guilds based on achievements, realmRanker - World of Warcraft Guild Ranking (would love feedback if you'd like to check it out, pm me).

I'm still working out the bugs, but the base functionality is there and seems to work well enough. I love how you've displayed the player achievements in the nice table - I may need to work something like that onto my realm / guild pages somehow. My next big thing to do is work on achievement reporting.

It's all in Java, but I think I might put it up on Google Code once it's all done and working well.

<irL> - looking for members today! Inktomi#1227

United States Offline
Reply With Quote
Old 03/08/09, 10:38 AM   #44
Bukama
Glass Joe
 
Tauren Warrior
 
Wrathbringer (EU)
Originally Posted by Tanoh View Post
Your post inspired me to write one for my guild. It's just done for my personal enjoyment and not going to be made into a general tool. It's written in perl and uses a common package I've developed for all my armory digging.

The result can be seen here: Insomnia achievements
This is one I am also looking for my own guild, but I cant code pearl. This script in PHP would be awesome

Offline
Reply With Quote
Old 03/08/09, 8:19 PM   #45
StarletRox
Glass Joe
 
Orc Hunter
 
Shattered Hand (EU)
Originally Posted by Bukama View Post
This is one I am also looking for my own guild, but I cant code pearl. This script in PHP would be awesome
I did a script in python with inspiration (by design, not the code) from his idea. Looks like: [ Dies Irae on Shattered Hand ] created by Morirai @ Shattered Hand EU (yep, my guild's name is funnily enough the same as yours.)

You just need to setup a few variables and run the script and it creates a nice html file.

The problem is that the code is so messy and unorganized I'm actually ashamed of realeasing it to the public, if you want to try it out just tell me and I'll try to clean up the mess.

Offline
Reply With Quote
Reply

Go Back   Elitist Jerks » Public Discussion » Public Discussion

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Warcraft Armory Nite_Moogle Public Discussion 336 06/29/07 4:46 PM
Unpopular talents, or the Armory in action Navaash Public Discussion 303 05/16/07 1:24 AM
In Game Armory Mod Maligne User Interface and AddOns 29 05/07/07 11:37 AM
[All Classes] Armory data used to see 31 and 41 pt talent use. Nomad_Wanderer Class Mechanics 2 05/03/07 11:23 AM