Saturday, June 21, 2008

How to get orkut login with PHP

header("Content-Type: text/html; charset=UTF-8"); // maybe you need to change the charset
require('class.XMLHttpRequest.php');

$req = new XMLHttpRequest();
$req->open("GET","https://www.google.com/accounts/ClientLogin?Email=your@email.login&Passwd=yourgoogleaccontpassword&service=orkut&skipvpage=true&sendvemail=false");
$req->send(null);

preg_match("/auth=(.*?)\n/i", $req->responseText, $auth);

$req->open("GET","http://www.orkut.com/RedirLogin.aspx?auth=".$auth[1]);
$req->send(null);

preg_match("/orkut_state=[^;]*/i", $req->getResponseHeader('Set-Cookie'), $orkut_state);

$req->open("GET","http://www.orkut.com/Community.aspx?cmm=43558952");
$req->setRequestHeader("Cookie",$orkut_state[0]);
$req->send(null);

echo $req->responseText;
?>

No comments: