Armory parseing code

Miscellaneous code snippets and examples that members have posted

Armory parseing code

Postby lart » Tue Mar 20, 2007 7:55 am

I haven't seen anyone else working on this code and I don't see anything on the armory site that says you can't use it and there's not robots.txt. Right now I just parse out the guild page. This script needs curl and I think php 4.3 might need 5.
There's some info that I can't get from the armory so havening it import data into the roster is going to be a little harder as I can't just use the code that's already there.
What I need to have done is for people to test out the code and let me know how you broke it. I have plans to import data to the database at some point but that's after i get some more stuff parsing.
Attachments
armory.zip
version .0.1
(8.19 KiB) Downloaded 125 times
Last edited by lart on Tue Mar 20, 2007 7:58 am, edited 1 time in total.
lart
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Thu Aug 03, 2006 8:23 am

Armory parseing code

Postby Toto » Tue Mar 20, 2007 12:54 pm

Some code was already posted here to better do the parsing.

With this code you get a XML file that you can easily parse with the xml parser of your choice. No Page checking and html gathering.

$curl = curl_init();
$fp = fopen("Temp/Tolriq.xml", "w");
$useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
curl_setopt($curl, CURLOPT_USERAGENT, $useragent);
curl_setopt ($curl, CURLOPT_URL, "http://armory.wow-europe.com/guild-info.xml?r=Ysondre&n=Dark%20Legion");
//curl_setopt ($curl, CURLOPT_URL, "http://armory.wow-europe.com/character-sheet.xml?r=Ysondre&n=Arawn");
//curl_setopt ($curl, CURLOPT_URL, "http://armory.wow-europe.com/character-talents.xml?r=Ysondre&n=Arawn");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FILE, $fp);
curl_exec ($curl);
curl_close ($curl);
Toto
WR.net Apprentice
WR.net Apprentice
 
Posts: 5
Joined: Sun Jan 14, 2007 8:53 pm

Re: Armory parseing code

Postby Kristoff22 » Tue Mar 20, 2007 9:45 pm

I saw this post a little late, but I've already created a synch addon between Armory and Roster. You can see it here: http://www.wowroster.net/Forums/viewtopic/t=3117.html
Kristoff22
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 103
Joined: Mon Nov 13, 2006 5:54 am

Re: Armory parseing code

Postby lart » Thu Mar 22, 2007 12:49 am

oo I'm glad that I posted this before I did much more work. I wonder why I didn't see that when I searched.
lart
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Thu Aug 03, 2006 8:23 am

Armory parseing code

Postby jungzandvliet » Thu Mar 22, 2007 10:21 pm

Becouse this one is earlyer posted theN:
http://www.wowroster.net/Forums/viewtopic/t=3117.html
jungzandvliet
WR.net Apprentice
WR.net Apprentice
 
Posts: 10
Joined: Sat Aug 05, 2006 8:17 pm


Return to Code Cache

Who is online

Users browsing this forum: No registered users and 0 guests

cron