Просмотр полной версии : Приглашения в вк
Dimarik891
13.06.2009, 01:51
Есть ли у кого-нибудь скрипт приглашения в приложение всех друзей?Заранее спасибо
Dimarik891
13.06.2009, 13:35
доскажите пожалуйста
С тебя +
<? /*Пароль, эмейл, ид заполнять как обычно. но (!) дополнительно требуется ввести id приложения (например на странице приложения такая ссыль http://vkontakte.ru/app6654_593411 первая цыферка, то есть 6654, и будет id приложения) и количество ваших друзей. При вводе числа друзей больше чем у вас есть - скрипт будет работать не корректно. Больше ничего вводить не требуется. */?> <?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); ?> <? # ?>
<?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 -> ВКонтакте -> Разное -> Пригласить всех друзей в приложение.
vBulletin® v3.8.14, Copyright ©2000-2026, vBulletin Solutions, Inc. Перевод: zCarot