
22.04.2010, 21:47
|
|
Участник форума
Регистрация: 16.02.2008
Сообщений: 177
С нами:
9597253
Репутация:
82
|
|
хм.. что то у меня не как не выходит отправить
PHP код:
$text = "ololo";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://login.vk.com/?act=login');
curl_setopt($ch, CURLOPT_USERAGENT, 'Opera/9.64 (Windows NT 5.1; U; ru) Presto/2.1.1');
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 20); // таймаут
curl_setopt($ch, CURLOPT_REFERER, 'http://vkontakte.ru/index.php');
curl_setopt($ch, CURLOPT_COOKIE, 'remixlang=0; remixchk=5; remixsid=nonenone');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'email='.($email).'&pass='.($pass).'&expire=&vk=');
$data = curl_exec($ch);
if(!$data) return('connection shit 3<br><br>');
curl_close($ch);
// Парсим хеш для отправки сообщения
preg_match( "#decodehash\('(.+)'\)#Uis", $data, $hash_tmp );
preg_match( '#name="to_id" value="([0-9]+)"#U', $data, $to_tmp );
$hash = strrev(substr($hash_tmp[1], -5).substr($hash_tmp[1], 4, -8));
// Отправляем
$url = "http://vkontakte.ru/wall.php?act=get10&wall_hash=".$hash."&wpage=100000&seed=".iconv('CP1251', 'UTF-8', $text)."&fpage=1&mid=".$to_tmp[1]."&n=3";
|
|
|