session[username_or_email]=Auto_gues
session[password]=curlphpcool
scribe_log=["{\"event_name\":\"web:front:login_callout:form::login_click\",\"noob_level\":null,\"internal_referer\":null,\"user_id\":0,\"page\":\"front\",\"_category_\":\"client_event\",\"ts\":1331839832141}"]
redirect_after_login=
Цитата (Rigel @ 16.03.2012 - 16:01) |
Сразу вопрос, а почему именно HttpFox, а не Fiddler? Или разницы нет? |
redirect_after_login=
не правильно :)$data = array(
'accountType' => 'GOOGLE',
'Email' => $email,
'Passwd' => $password,
'service' => 'analytics',
'source' => ''
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.google.com/accounts/ClientLogin");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
$auth = '';
if($info['http_code'] == 200) {
preg_match('/Auth=(.*)/', $output, $matches);
if(isset($matches[1])) {
$auth = $matches[1];
}
}
Цитата |
SID=DQAAAHsAAAA etc etc LSID=DQAAAH4AAA etc etc Auth=DQAAAH4AAA etc etc |
$headers = array("Authorization: GoogleLogin auth=$auth");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);