Показать сообщение отдельно

  #4  
Старый 14.06.2009, 02:03
PROPH3T
Новичок
Регистрация: 20.11.2007
Сообщений: 13
Провел на форуме:
681237

Репутация: 1
По умолчанию

Код:
<?php  
set_time_limit(0);  
error_reporting(E_ERROR | E_PARSE);  
$mail='Тут ваше мыло';  
$pass='Тут ваш пасс';  
$id='Тут ваш  id ';  
$app_id = 'Тут id приложения';  
$friends_num = Тут количество друзей;  
$cookie='remixmid='.$id.'; remixemail='.$mail.'; remixpass='.md5($pass).';remixlang=3';  

function fff($link, $cookie){  
$ch = curl_init();  
curl_setopt($ch, CURLOPT_URL,$link);  
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);  
curl_setopt($ch, CURLOPT_TIMEOUT, 10);  
curl_setopt($ch, CURLOPT_GET, 1);  
curl_setopt($ch, CURLOPT_HEADER, 1);   
curl_setopt($ch, CURLOPT_COOKIE, $cookie);  

$otvet = curl_exec($ch);  
curl_close($ch);  
return $otvet;  
}  
$link = "http://vkontakte.ru/friend.php?id=".$id;  
$res = fff($link, $cookie);  
$end = strpos($res, "list:[");  
$end = $end + strlen("list:[");  
for($i = 0; $i < $friends_num; $i++)  
{  
$start = strpos($res, "[", $end);  
$start = $start + strlen("[");  
$end = strpos($res, ",", $start);  
$str = substr($res, $start, $end - $start);  
$massiv[$i] = $str;  
}  

$link = "http://vkontakte.ru/app".$app_id."_".$id;  
$res = fff($link, $cookie);  
$start = strpos($res, "var app_hash = '");  
$start += strlen("var app_hash = '");  
$end = strpos($res, "'", $start);  
$appl_hash = substr($res, $start, $end - $start);  

$header = "POST /apps.php?act=a_invite_friends HTTP/1.1\r\n";  
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";  
$header .= "X-Requested-With: XMLHttpRequest\r\n";  
$header .= "User-Agent: Opera/9.63 (Windows NT 5.1; U; ru) Presto/2.1.1\r\n";  
$header .= "Host: vkontakte.ru\r\n";  
$header .= "Referer: http://vkontakte.ru/app".$app_id."_".$id."\r\n";  
$header .= "Cookie: ".$cookie."\r\n";  
$header .= "Cookie2: \$Version=1\r\n";  
$header .= "Connection: Keep-Alive, TE\r\n";  
$header .= "TE: deflate, gzip, chunked, identity, trailers\r\n";  
$data = "friends=";  
for($i = 0; $i < $friends_num - 1; $i++)  
{  
$data .= "".$massiv[$i]."%2C";  
}  
$data .= $massiv[$friends_num - 1]."&app_id=".$app_id."&app_hash=".$appl_hash;  
$header .= "Content-length: " . strlen($data) . "\r\n";  
$header .= "Content-Transfer-Encoding: binary\r\n\r\n";  

$fp = fsockopen("vkontakte.ru", 80);  
fputs($fp, $header.$data);  
$i = 0;  
$response = "";  

while ($i < 10) {  
echo"ok?$i\n";  
$response .= fgets($fp, 128);  
$i++;  
}  

echo"\n\n\n$response\n\n";  
fclose($fp);  

?>

Хз, пашет или нет на данный момент


---------------------
MusicSig -> ВКонтакте -> Разное -> Пригласить всех друзей в приложение.

Последний раз редактировалось PROPH3T; 14.06.2009 в 02:06..
 
Ответить с цитированием