02-04-2009, 11:31 PM
|
#27 (permalink)
|
|
The Contributor
Join Date: Feb 2009
Posts: 65
Thanks: 0
|
EDIT
Posted a few hours too early.
PHP Code:
<html>
<body>
<?php
if (isset($_POST['submit'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$authenticate = $_POST['authenticate'];
$postvars = "accountName=" . $username . "&password=" . $password;
define(US_LOGIN_URL, 'https://www.blizzard.com/login/login.xml?referer=http%3A%2F%2Fwww.wowarmory.com%2Fvault%2Fguild-bank-log.xml%3Fr%3DMy%2BRealm%26n%3DMy%2BGuild&loginType=com');
$ch = curl_init(US_LOGIN_URL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
$returnedPage = curl_exec($ch);
curl_close($ch);
if (strstr($returnedPage, "Invalid account name or password")) {
echo "FAIL: Invalid account name or password<br>";
}
elseif (strstr($returnedPage, "Account name required")) {
echo "FAIL: Invalid account name or password<br>";
}
elseif (strstr($returnedPage, "Password required")) {
echo "FAIL: Invalid account name or password<br>";
}
elseif (strstr($returnedPage, "Authenticator code required")) {
echo "FAIL: Invalid Authenticator code<br>";
}
elseif (strstr($returnedPage, "Login failed")) {
echo "FAIL: Invalid account name or password<br>";
}
elseif (strstr($returnedPage, "Authenticator Code")) {
$postauth = "authValue=" . $authenticate;
$ch = curl_init(US_LOGIN_URL);
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postauth);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
$returnedPage = curl_exec($ch);
curl_close($ch);
echo $returnedPage;
}
else {
echo $returnedPage;
}
}
else {
?>
<form action="banklog.php" id="loginForm" method="post">
Account Name<input id="username" name="username" type="text" /><br>
Password<input id="password" name="password" type="password" /><br>
Authenticator<input id="authenticate" name="authenticate" type="text" /><br>
<input type="submit" name="submit" value="Submit">
</form>
<?php
}
?>
</body>
</html>
It's a bit sloppy but it works to get the bank logs open, I will clean it up more later. But I am not having any luck getting the XML out of it. I have parsed XML off other WoW pages but I can't off this I keep getting HTML and javascript. Any thoughts here.
Last edited by Krik : 02-05-2009 at 04:07 AM.
|
|
|
|