Начал разработку нового проекта.
Инсайде положу скрипт логина на квантакте
<?php
class vk
{
private function socket_do($action, $method, $header = false, $timeout = 10, $params = false,
$follow = false, $cookie = false, $referer = false)
{
sleep($this->delay);
$ch = curl_init();
if (strtoupper($method) == 'GET') {
$action .= '?' . $params;
curl_setopt($ch, CURLOPT_URL, $action);
curl_setopt($ch, CURLOPT_HTTPGET, 1);
} elseif (strtoupper($method) == 'POST') {
curl_setopt($ch, CURLOPT_URL, $action);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
} else {
curl_setopt($ch, CURLOPT_URL, $action);
}
if ($this->proxy) {
curl_setopt($ch, CURLOPT_PROXY, $this->proxy);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $follow);
curl_setopt($ch, CURLOPT_FAILONERROR, false);
curl_setopt($ch, CURLOPT_HEADER, $header);
curl_setopt($ch, CURLOPT_USERAGENT,
'Opera/9.80 (Windows NT 6.0; U; ru) Presto/2.2.20 Version/10.00');
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
$done = curl_exec&#40;$ch&#41;;
curl_close($ch);
return $done;
}
private function pregCookie($headers)
{
preg_match_all('#Set-cookie: (.*;)#UiS', $headers, $headers);
return trim(implode('', $headers['1']));
}
public function getCookies($email, $pass)
{
$first = $this->socket_do('', 'POST', true, 20,
'email=' . urlencode($email) . '&pass;=' . urlencode($pass) . '&expire;=&vk;=');
if (preg_match('~id=\'s\'\s+value=\'(\w+)\'~Ui', $first, $reg)) {
$tempS = trim($reg['1']);
$two = $this->socket_do('', 'POST', true, 20,
'op=slogin&redirect=1&expire=0&to;=&s;=' . $tempS);
echo $this->pregCookie($two);
}
}
}
$vk = new vk();
$vk->getCookies("wharrgarbl.team@gmail.com", "recoilme");
?>
?>
как проект поживает?)
(0)  Написал IgorZhelez, 2010-02-12 19:42:30 ответить