Форум АНТИЧАТ

Форум АНТИЧАТ (https://forum.antichat.xyz/index.php)
-   Социальные сети (https://forum.antichat.xyz/forumdisplay.php?f=133)
-   -   Спасок аков, одна группа (https://forum.antichat.xyz/showthread.php?t=103233)

deniska1517 26.01.2009 21:29

Спасок аков, одна группа
 
Как пригласить всех друзей в группу и самому вступить? Поделитесь скриптом...

>.:!FrE!:.< 26.01.2009 22:20

PHP код:

<?php
##########################
#        Vkontakte Inviter By Chaаk
##########################
set_time_limit(0);

class 
vkInviter
{
    private 
$accounts#аккаунты
    
private $proxy false#прокси
    
private $cookies = array(); #кукисы
    
private $friends = array(); #друзья
    
private $gid;


    private function 
socket_do($action,$method,$header false,$timeout 10,$params false,$follow false,$cookie false,$referer false)
    {
        
$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.62 (Windows NT 6.0; U; ru) Presto/2.1.1');
        
curl_setopt($ch,CURLOPT_REFERER,$referer);
        
curl_setopt($ch,CURLOPT_COOKIE,$cookie);
        
curl_setopt($ch,CURLOPT_TIMEOUT,$timeout);
        
$done curl_exec($ch);
        
curl_close($ch);
        return 
$done;
    }


    private function 
pregCookie($headers)
    {
        
preg_match_all('#Set-cookie: (.*;)#UiS',$headers,$headers);
        
$this->cookies[] = preg_replace('#remixlang=[0-9]+#','remixlang=0',implode('',$headers['1']));
    }

    private function 
putText($text)
    {
        echo 
$text.'<br>';
        
flush();
        
ob_flush();
    }

    public function 
SetPref($gid,$accounts,$proxy false)
    {
        
$this->gid $gid;
        
$this->accounts $accounts;
        
$this->proxy $proxy;
    }

    private function 
getFriends($num)
    {
        
$res $this->socket_do('http://pda.vkontakte.ru/write','POST',true,10,false,true,$this->cookies[$num]);
        
preg_match_all('#<option value\="([0-9]+)" >#UiS',$res,$friends);

        
$this->friends[] = $friends['1'];
    }

    public function 
getCookies_N_Friends()
    {
        
$this->putText('Начало авторизации аккаунтов...');
        foreach(
$this->accounts as $acc)
        {
            list(
$email,$pass) = explode(':',trim($acc));
            
$res $this->socket_do('http://pda.vkontakte.ru/login?pda=index&acknowledge=0','POST',true,10,"email=$email&pass=$pass",true);
            if(
strstr($res,'302 Found') || strstr($res,'302 Moved'))
            {
                
$this->pregCookie($res);
            }
        }
        
sleep($this->delay);
        
$this->putText('Авторизовано: '.count($this->cookies).' аккаунтов.');
        
$this->putText('Начало сбора друзей...');
        foreach(
$this->cookies as $key => $cook)
        {
            
$this->getFriends($key);
        }
        
$frcount 0;
        foreach(
$this->friends as $friends)
        {
            
$frcount += count($friends);
        }
        
$this->putText('Всего: '.$frcount.' друзей для приглашений... Начало приглашений');

        
sleep(2);
    }

    public function 
invite()
    {
        for(
$i 0,$c count($this->accounts); $i $c$i++)
        {
            
$makestr 'act=ainvitefriends&gid='.$this->gid;
            foreach(
$this->friends[$i] as $friend)
            {
                
$makestr .= '&'.trim($friend).'=1';
            }
            if(
strstr($this->socket_do('http://vkontakte.ru/groups_ajax.php','POST',1,10,$makestr,1,$this->cookies[$i]),'ok'))
            {
                
$this->putText('Отправлено - '.count($this->friends[$i]).' приглашений(я)...');
            }
            else
            {
                
$this->putText('Приглашения не отправлены.');
            }

            
sleep(4);
        }
        echo 
'Закончено!';
    }
}

if(!
$_POST['start'])
{
?>
        <center>
            <form action="" method="POST">
            <table>
                <tr><td align="center">ID группы: </td><td><input type="text" name="gid" size="16"/></td></tr>
                <tr><td align="center">Proxy(не обяз.): </td><td><input type="text" name="proxy" size="16"/></td></tr>
                <tr><td colspan="2" align="center">Аккаунты:</td></tr>
                <tr><td colspan="2" align="center"><textarea name="accounts" rows="15" cols="50"></textarea>
                <tr><td colspan="2" align="center"><input type="submit" name="start" value="Разослать инвайты"/></td></tr>
            </table>
            </form>
        </center>
    <?php
}
else
{
    echo 
'<center>';
    
$vk = new vkInviter();
    
$vk->SetPref($_POST['gid'],explode("\n",trim($_POST['accounts'])),trim(@$_POST['proxy']));
    
$vk->getCookies_N_Friends();
    
$vk->invite();
    echo 
'</center>';
}
?>

[/CENTER]
Приглашает всех друзей аккаунтов в указанную группу вконтакте. Требуется чтобы группа была открыта для приглашений.

Скрипт требует поддержки хостингом cURL. Из локальных серверов подойдет WAMPSERVER.




ВОТ ОТ ЧАКА

Ylka 27.01.2009 16:35

Разве он рабочий

Ктото проьивал ???

>.:!FrE!:.< 28.01.2009 21:47

Для придурков которым лень попробывать самим, то да...
P.S. Чак респект!) Это первая реальная приглошалка выплавшая в паблик!!!


Время: 11:44