View Single Post
Old 02-04-2009, 11:31 PM   #27 (permalink)
Krik
The Contributor
 
Join Date: Feb 2009
Posts: 65
Thanks: 0
Krik is on a distinguished road
Default

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($chCURLOPT_POST1);
    
curl_setopt($chCURLOPT_POSTFIELDS$postvars);
    
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
    
curl_setopt($chCURLOPT_HEADER0);
    
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
    
curl_setopt ($chCURLOPT_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($chCURLOPT_COOKIEFILE"cookie.txt");
        
curl_setopt($chCURLOPT_POST1);
        
curl_setopt($chCURLOPT_POSTFIELDS$postauth);
        
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
        
curl_setopt($chCURLOPT_HEADER0);
        
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
        
curl_setopt ($chCURLOPT_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.
Krik is offline  
Reply With Quote