Antichat снова доступен.
Форум Antichat (Античат) возвращается и снова открыт для пользователей.
Здесь обсуждаются безопасность, программирование, технологии и многое другое.
Сообщество снова собирается вместе.
Новый адрес: forum.antichat.xyz

30.04.2009, 09:41
|
|
Новичок
Регистрация: 23.04.2009
Сообщений: 16
Провел на форуме: 437710
Репутация:
-2
|
|
инвайтер в приложения
народ впомогите , в одном из разделов нашёл исходник для приглашения в приложение, и не могу понять что с ним делать, можете ктонить обяснить, как его наладить.
исходник
<?php
set_time_limit(0);
error_reporting(E_ERROR | E_PARSE);
$mail='qwe@qwe'; /мыло
$pass='qweqwe'; //пасс
$id='00000000'; //id
$app_id = '0000'; //id приложения
$friends_num = 9; // кол-во друзей
$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);
?>
|
|
|
|
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|