wow_ah is a complete php api for the WoW Armory AH by https://github.com/kaysond that is carefully designed to mimic a normal browser. It supports all of the features of the website and comes with an example command line interface for the api. Errors are handled through a custom exception, and while everything has been tested, there are likely some scenarios that are not yet handled explicitly. Enabling logging can help debug.
- Saves login session
- AH Searching
- Place bids/buyouts
- Create auctions
- Cancel auctions
- Claim money from mailbox
- Check auctions and inventory
- Logging
Full documentation is in the docs folder. Also in the code.
is_logged_in()
- Returns true if the API has a valid login session (it attempts to save sessions between uses)login()
- Logs the user inget_character_list()
- Lists the characters on the accountselect_character()
- Chooses the character to use for transactionssearch()
- Perform a search of the AHbid()
- Bid on or buyout an auctionupdate_inventory()
- Get the selected character's bags, mail, and bank inventorycreate_auction()
- Create one or more auctions for an item (supports splitting into stacks)update_auctions()
- Get the selected character's active, sold, and ended auctionscancel_auction()
- Cancel a specific auctiontake_money()
- Take the money from a specific piece of mailtake_all_money()
- Take all money in the selected character's mailboxclose()
- Shuts down the API cleanly, especially saving the cookies to a file. Use this!
The command line test interface is implemented in wow_ah_test.php. Run with php -f wow_ah_test.php
and enter help
to see commands.
- php7
- curl
- openssl
- libxml
- v8js
- murmurhash3
Pre-compiled 32-bit and 64-bit Windows php binaries
See https://github.com/kaysond/wow_ah_bot
require("wow_ah.class.php");
$browser = array(
"useragent" => "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0",
"language" => "en-US",
"resolution" => array(1080, 1920),
"timezoneoffset" => 480,
"randomseed" => "fiftydkpminus",
"headers" => "Accept-Language: en-US,en;q=0.5\nDNT: 1"
);
try {
$wow_ah = new wow_ah\wow_ah("us","en","cookiejar.txt", "log.txt", $browser);
$wow_ah->login("leeroy", "jenkins");
//Useful if we want to see how much of an item we have already bought
//and how much is in our inventory, before making purchases
$wow_ah->update_inventory();
$wow_ah->update_auctions();
$wow_ah->take_all_money();
//Search for the 40 cheapest copper ore auctions
$results = $wow_ah->search("Copper Ore", "-1", "-1", "-1", "-1", "unitBuyout", false, 40);
//Buy ore under 1g/unit up to 10 units
$units_purchased = 0;
foreach ($results as $result) {
if ($result->unitBuyout < 10000 && $units_purchased + $result->quantity <= 10) {
$wow_ah->bid($result->id, $result->buyout);
$units_purchased += $result->quantity;
}
if ($units_purchased == 10)
break;
}
}
catch (wow_ah\Exception $e) {
echo "Caught exception: " . implode(" ", $e->getAllMessages()) . "\n";
}