 |
10/23/08, 10:37 AM
|
#1
|
|
Bald Bull
Gnome Warrior
Earthen Ring
|
Armory Scraping
Has anyone figured out how to scrape the XML for Armory calendars yet? Using Firefox as the user-agent and going through the login process works fine, but once I get to the actual calendar page ( https://www.wowarmory.com/vault/char...en+Ring&n=Abbi, e.g.) I get a very barebones XML page with only my basic character information on it.
Examining the XSLT stylesheet leads me to think that http://www.wowarmory.com/calendar/js/calendar.js has the meat of the calendar stuff, but my JavaScript is not good enough to figure out how to get event data. Given event data, I'd be writing perl to generate .ICS files for iCal.
|
|
|
|
|
10/23/08, 11:29 AM
|
#2
|
|
Glass Joe
Night Elf Hunter
Dun Modr (EU)
|
The calendar use JSON instead XML to retrieve the information. You can use Firebug and inspect the Net tab.
|
|
|
|
|
03/13/09, 8:26 PM
|
#3
|
|
Glass Joe
|
I'm wondering if you're still working on a project of this sort? I have the same desire, to pull armory data and store locally. Over the past couple days I have been working on something to do this, and it's near complete. The only problem with the armory calendar data is that you need to login. This is not a problem to program, however it will deter many users as they will need to supply their login information to the script. I imagine the only users that would be comfortable in doing so would be those that can execute this locally and have complete control over that information, as to automate it the script needs a way to retrieve the login information without it being supplied each execution. This works very well for me as I host my own Solaris 10 box, I know the login information isn't going to be seen by anyone but me, and if it is- well then I have much larger problems than a compromised wow account.
To make a long post short, I wanted to share some useful information regarding access this data via the armory mechanically.
Rather than create some fancy perl code to connect to the armory to download the calendar, I choose to use wget. An initial wget call logs into the armory and stores a cookie on my server, the subsequent calls pass the stored cookie. The actual calendar call is as simple as:
/usr/sfw/bin/wget --keep-session-cookies --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" --load-cookies="/vdsk/projects/wow/armory/tmp/calcookie.tmp" --output-document "/dsk/projects/wow/armory/tmp/calholidayWeekly.tmp" "http://www.wowarmory.com/vault/calendar/month-world.json?type=holidayWeekly&month=3&callback=calendar&year=2009&loc=1&loginType=com " > /dev/null 2>&1
As an example of the calendar data returned from the armory, below is the Darkmoon schedule for March 2009.
calendar({"now":1236989274033,"month":3,"events":[{"summary":"Darkmoon Faire","calendarType":"darkmoon","start":1236596400033,"calendarTypeId":6,"end":12372 01200033,"icon":"Calendar_DarkmoonFaireElwynn","description":"The Darkmoon Faire is here, this time in idyllic Elwynn Forest.\r\n\r\nMeet Silas Darkmoon and his troupe, play games that test mind and nerve, and behold exotic sights from the four corners of Azeroth... and beyond!","priority":1}],"calendarType":"darkmoon","year":2009,"tz":-25200000});
Obviously the script would need to parse through this information to produce something meaningful, but again that's not a problem at all.
You can also craft messages to the armory site to get the detail list from the high level calendar entry, and even accept or decline the invitation. I, however, don't see a lot of use in accepting or declining mechanically, some user decision would need to be made, and personally I make the decision in game. My script will simply be used to download calendar activity and send email notifications, to me, when an event as been added, removed or is about to occur.
|
|
|
|
|
04/23/09, 12:14 AM
|
#4
|
|
Glass Joe
Human Death Knight
Blackrock
|
I've been able to authenticate to Battle.Net and scrape calendar data (turning it into iCalendar data for iCal / Google Cal) -- Armory Calendar to ICS
The issue is, at the moment to do it, I need to collect Battle.Net login info. The code is at http://aftermath.cx/wow/armory-tools/Calendar.zip if you want to try it yourself (requires PHP with JSON support, that cookies.tmp be writable, and the HTTP auth may not work on your server (hack to make it work with php-cgi))
|
|
|
|
|
05/20/10, 8:07 AM
|
#5
|
|
Bald Bull
|
(thread necro)
Blizzard has released an API that allows access to the auction house. Here is some technical data to aid in writing things to make use of this functionality.
Get JSON results: http://www.wowarmory.com/auctionhouse/search.json
Get XML results: http://www.wowarmory.com/auctionhouse/search/index.xml ( be sure to include rhtml=false or you will get HTML data back!)
note: There is a maximum of 200 results returned per query.
Search parameters you can use:
| Key | Description | Values |
|---|
| filterId | maps to ah categories | (see below) | | maxLvl | maximum level required | any valid character level | | minLvl | minimum level required | any valid character level | | qual | item quality | 0=poor, 1=common, 2=uncommon, 3=rare, 4=epic | | reverse | reverse the sort output | true, false | | sort | column to sort by | rarity, quantity, level, time, buyout |
Filter categories:
| Id | Description |
|---|
| 0 | Weapon | | 1 | Armor | | 2 | Container | | 3 | Consumable | | 4 | Glyph | | 5 | Trade Goods | | 6 | Projectile | | 7 | Quiver | | 8 | Recipe | | 9 | Gem | | 10 | Miscellaneous |
note: You can filter into sub-categories and sub-sub-categories by separating the id's with a comma. filterId=0,78 would show one-handed axes. I haven't figured out how to gather up what all the sub-category id's are short of searching by hand, if you have any ideas, send me a PM.
Data that is returned:
| Key | Description |
|---|
| auc | Auction ID | | bid | Bid price | | buy | Buyout price | | charges | Charges | | date | Date posted | | icon | Icon | | id | Item ID | | ilvl | Item Level | | n | Item name | | nbid | Next minimum bid | | ppuBid | Price per unit (bid) | | ppuBuy | Price per unit (buyout) | | qual | Item quality | | quan | Quantity | | req | Required level | | seller | Seller | | time | Time left (1=short,2=medium,3=long,4=very long) |
Last edited by Slackie : 05/24/10 at 3:39 AM.
|
|
|
|
|
05/21/10, 12:52 PM
|
#6
|
|
stalemate associate
Blood Elf Paladin
Mal'Ganis
|
All done! If anyone cares to fill in the missing categories, that'd be nice.
| FilterId result | | 0 Weapon | | 1 Armor | | 2 Container | | 3 Consumable | | 4 Glyph | | 5 Trade Goods | | 6 Projectile | | 7 Quiver (all) | | 8 Recipe | | 9 Gem | | 10 Miscellaneous | | 11 Quest | | 12 | | 13 Two-Handed Maces | | 14 Cooking Recipe | | 15 Herb Bag | | 16 Dagger | | 17 Orange Gem | | 18 One-Handed Maces | | 19 Bullets | | 20 Enchanting Bag | | 21 Arrows | | 22 Thrown Weapon | | 23 One-Handed Swords | | 24 | | 25 Purple Gem | | 26 Soul Shard Bag | | 27 Meta Gem | | 28 Warlock Glyph | | 29 Leatherworking Bag | | 30 Mage Glyph | | 31 Reagent | | 32 Trade Goods (Elemental) | | 33 Fishing Poles | | 34 Armor (Misc) | | 35 Fist Weapons | | 36 | | 37 Inscription Bag | | 38 Holiday | | 39 Junk | | 40 | | 41 Bow | | 42 Wand | | 43 Armor (Cloth) | | 44 Leatherworking Recipe | | 45 Alchemy Recipe | | 46 Food & Drink | | 47 Two-Handed Swords | | 48 | | 49 Crossbows | | 50 Blue Gem | | 51 Jewelcrafting Recipe | | 52 Yellow Gem | | 53 Totem | | 54 Enchanting Recipe | | 55 | | 56 Druid Glyph | | 57 Recipe (Book) | | 58 Container (Bag) | | 59 First Aid Recipe | | 60 Idol | | 61 Staff | | 62 Misc (Other) | | 63 Polearm | | 64 Gun | | 65 Rogue Glyph | | 66 Warrior Glyph | | 67 Shield | | 68 Ammo Pouch | | 69 Mount | | 70 Blacksmithing Recipe | | 71 Death Knight Glyph | | 72 | | 73 Red Gem | | 74 Libram | | 75 Tailoring Recipe | | 76 Quiver | | 77 Armor (Leather) | | 78 One-Handed Axes | | 79 | | 80 Paladin Glyph | | 81 Quest | | 82 Two-Handed Axes | | 83 Armor (Mail) | | 84 Priest Glyph | | 85 | | 86 | | 87 Armor (Plate) | | 88 Hunter Glyph | | 89 Prismatic Gem | | 90 Trade Goods (Enchanting) | | 91 Pet | | 92 Misc. Weapons | | 93 Shaman Glyph | | 94 Engineering Recipe | | 95 Mining Bag | | 96 Green Gem | | 97 Jewelcrafting Bag | | 98 Simple Gem | | 99 Cloth | | 100 Potion | | 101 Leather | | 102 Elixir | | 103 Metal & Stone | | 104 Flask | | 105 Meat | | 106 Bandage | | 107 Herb | | 108 Item Enhancement | | 109 Scroll | | 110 Consumable (Other) | | 111 Jewelcrafting | | 112 Inscription | | 113 Devices | | 114 Explosives | | 115 Trade Goods (Materials) | | 116 Trade Goods (Other) | | 117 Armor Enchantment | | 118 Weapon Enchantment | | 119 Armor (Misc Head) | | 120 Armor (Neck) | | 121 Armor (Shirt) | | 122 Armor (Ring) | | 123 Armor (Trinket) | | 124 Armor (Offhand) | | 125 Armor (Cloth Head) | | 126 Armor (Cloth Shoulder) | | 127 Armor (Cloth Chest) | | 128 Armor (Cloth Waist) | | 129 Armor (Cloth Legs) | | 130 Armor (Cloth Feet) | | 131 Armor (Cloth Wrists) | | 132 Armor (Cloth Hands) | | 133 Armor (Cloak) | | 134 Armor (Leather Head) | | 135 Armor (Leather Shoulder) | | 136 Armor (Leather Chest) | | 137 Armor (Leather Waist) | | 138 Armor (Leather Legs) | | 139 Armor (Leather Feet) | | 140 Armor (Leather Wrists) | | 141 Armor (Leather Hands) | | 142 Armor (Mail Head) | | 143 Armor (Mail Shoulder) | | 144 Armor (Mail Chest) | | 145 Armor (Mail Waist) | | 146 Armor (Mail Legs) | | 147 Armor (Mail Feet) | | 148 Armor (Mail Wrists) | | 149 Armor (Mail Hands) | | 150 Armor (Plate Head) | | 151 Armor (Plate Shoulder) | | 152 Armor (Plate Chest) | | 153 Armor (Plate Waist) | | 154 Armor (Plate Legs) | | 155 Armor (Plate Feet) | | 156 Armor (Plate Wrists) | | 157 Armor (Plate Hands) |
Last edited by malthrin : 05/27/10 at 7:49 PM.
|
|
|
|
05/21/10, 1:37 PM
|
#7
|
|
Still alive
Human Rogue
Cenarion Circle
|
I've discovered that by using a Keep-Alive header on my connections, I can pull data at approximately one request per 0.55 sec, rather than waiting that 0.55 sec + 1 sec per HTTP connection. If you can reuse connections in conjunction with keepalives, it'll speed you up a lot.
|
Need a Mumble server? I run MMO-Mumble for all your voice chat needs. | My rogue planning tool: Shadowcraft
|
|
|
05/21/10, 4:00 PM
|
#8
|
|
Von Kaiser
|
Here's a quick and dirty ruby implementation to get people started. You can get the cookie string straight from your cookies, or use firebug to look at the headers of a normal request after logging into the Armory.
#971617 - Pastie
|
|
|
|
|
05/21/10, 4:37 PM
|
#9
|
|
Still alive
Human Rogue
Cenarion Circle
|
I've got a Ruby project up and running already, actually. It uses Mechanize with keepalives to optimize throughput, and stores data in MongoDB for fast analysis and reporting.
http://github.com/cheald/AuctionBoss/
|
Need a Mumble server? I run MMO-Mumble for all your voice chat needs. | My rogue planning tool: Shadowcraft
|
|
|
05/21/10, 9:18 PM
|
#10
|
|
stalemate associate
Blood Elf Paladin
Mal'Ganis
|
Another search parameter, f, specifies which auction house to query.
| Value | Description | | 0 | Alliance AH | | 1 | Horde AH | | 2 | Neutral AH |
There are other valid values - probably corresponding to the various in-game auction house NPCs? But this is all you need.
edit:
Tested these sorting parameters from the javascript : 'sort' and 'reverse'. Reverse is a bool for ascending/descending. Sort can have the following values:
| Value | Description | | rarity | epics first | | name | alphabetical | | level | required level, highest first | | ilvl | item level, highest first | | bid | stack bid, lowest first | | buyout | stack buyout, lowest first | | unitbid | price per unit, lowest first | | unitbuyout | price per unit, lowest first | | time | time remaining, shortest first |
Last edited by malthrin : 05/23/10 at 10:12 AM.
|
|
|
|
05/22/10, 12:43 PM
|
#11
|
|
stalemate associate
Blood Elf Paladin
Mal'Ganis
|
Bids and buyouts are done via bid.json. The parameters are:
| Parameter | Description | | auc | AuctionId | | money | Amount to bid | | f | AH to buy from |
If your bid amount is less than the buyout, you place a bid on the item. If it is equal to the buyout, you buy out the item. If it's more than the buyout... someone else can test what happens then!
Here's the relevant javascript :
http://www.wowarmory.com/_js/auction/auction.js
Last edited by malthrin : 05/22/10 at 1:01 PM.
|
|
|
|
05/22/10, 1:32 PM
|
#12
|
|
stalemate associate
Blood Elf Paladin
Mal'Ganis
|
|
|
|
|
05/23/10, 9:54 PM
|
#13
|
|
Glass Joe
|
Using bid.json and bidding for more than the buyout results in a buyout of the item for the listed price, no extra money is spent.
mail.json is used to list the mail in your box while takeMail.json is used to move it from your mailbox to your inventory.
Any help on getting the search results in XML, I can only seem to find them in JSON.
EDIT: Also, changing 'pageSize' in the search parameters will give you more results (up to 50), and changing the 'start' parameter can be used to get further down the list after what the initial results show.
Last edited by luvmachine : 05/23/10 at 10:02 PM.
|
|
|
|
|
05/24/10, 12:16 AM
|
#14
|
|
Bald Bull
|
Originally Posted by luvmachine
Any help on getting the search results in XML, I can only seem to find them in JSON.
|
Check a few posts up for another one by me. It has the XML URL at the top.
How to post a new auction:
Step one: You need a "ticket", you get this by sending a GET request to http://www.wowarmory.com/auctionhouse/deposit.json
Options:
| Key | Description |
|---|
| id | Item ID | | duration | Length of auction (0=12h, 1=24h, 2=48h) | | quan | Number of items | | stacks | Number of stacks |
You will get a response that contains a few variables:
| Key | Description |
|---|
| ticket | Ticket | | deposit | Cost to create this auction (per item) | | totalDeposit | Cost to create this auction (overall) | | suggestedPrice | Unknown |
Step two: You use the ticket you have from step one and send a GET request to http://www.wowarmory.com/auctionhouse/create.json
Options:
| Key | Description |
|---|
| bid | Bid price for this item | | buyout | Buyout price for this item | | id | Item ID | | duration | Length of auction (0=12h, 1=24h, 2=48h) | | quan | Number of items | | stacks | Number of stacks | | ticket | Ticket you got from deposit.json | | guid | This will be blank for a single-stack auction |
note: If you are creating a multi-stack auction, create.json will return data in the guid field. Use the data from the guid field to populate the ticket field of your next request.
|
|
|
|
|
06/02/10, 12:34 AM
|
#15
|
|
Bald Bull
|
Anyone seeing a large amount of timeouts via the new AH API over the last 36 hours or so? I tried increasing my polling delay but still get errors which leads me to believe this is an actual problem not just polling too quickly.
|
|
|
|
|
|