Querying the Guild Bank in the Warcraft Armory
Just a quick code snippet. This isn’t ideal – it needs to be run twice in order to work. I’ll update it as I debug it, but I thought if I threw it ‘out there’ others can use/suggest changes as necessary. You should be very careful about putting this on a web site – you need to add your username/password so I’m running this in a cron job in a protected area of my server, with the output only going to a user-accessable area.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, “https://eu.wowarmory.com/login.xml”);
curl_setopt($ch, CURLOPT_USERAGENT, “# Mozilla/5.0 (Windows; U; Windows NT 6.0; sv-SE; rv:1.9.0.2) Gecko/2008091620 Firefox/3.0.2″);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, “accountName={youraccountname}&password={yourpassword}&redirectUrl=/vault/guild-bank-log.xml%3Fr=Steamwheedle+Cartel%26n=Argent+Dawn+Exiles”);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_REFERER, “http://eu.wowarmory.com/vault/guild-bank-log.xml?r=Steamwheedle+Cartel&n=Argent+Dawn+Exiles”);
curl_setopt($ch, CURLOPT_COOKIEFILE, “cookie.txt”);
curl_setopt($ch, CURLOPT_COOKIEJAR, “cookie.txt”);
$result1 = curl_exec($ch);
curl_setopt($ch, CURLOPT_URL, “http://eu.wowarmory.com/vault/guild-bank-log.xml?r=Steamwheedle+Cartel&n=Argent+Dawn+Exiles”);
$result2 = curl_exec($ch);
curl_close($ch);
echo $result2;
Mental note – this site shows how to do it all, connecting to Amazon…










