Vkontakte Search Beta

Discussion in 'PHP' started by -Hormold-, 11 Apr 2008.

  1. -Hormold-

    -Hormold- Кто, если не ты?

    Joined:
    29 Sep 2007
    Messages:
    418
    Likes Received:
    290
    Reputations:
    44
    Нужно было найти человека.
    Написал скрипт ещё давно, но сейчас решил выложить.
    Скрипт граббит страницы с ВКонтакте и сохраняет их потом парсит и сохраняет фотки!
    Вот города:
    Вот код:
    PHP:
    <?
    set_time_limit(0);
    $id="";//You Id
    $email="";//You email
    $password=md5("");//You password
    $sex="1";//1-Girl %)
    $city="1";//city in list
    $array=Array();
    for (
    $i=1$i<=900$i=$i+10) {
    $array[]=$i;
    }
    for(
    $i=0$i 90$i++){
    $r=rand(1,1000000);
    $rss=$array[$i];
    $fps="file/file".$r.".res";
    $adr="file/file".$r.".res";
    if(
    is_file($fps)){$fps=fopen($fps,"w");fclose($fps);}

    $fps=fopen($fps,"ab");
    $acc=get_next($rss,$id,$email,$pass,$sex,$city);
    fwrite($fps,$acc."\r\n");
    fclose($fps);
    echo 
    $adr;
    parse($adr);

    }

    function 
    parse($file){
    $g=file_get_contents($file);

    list(
    $dec,$null)=explode('search.php?subm=1',$g);
    $null=str_replace("'>2</a></li><li><a href='","",$null);

    $asd=explode('<div class="image">',$g);
    for(
    $i=1$i 20$i++){

    list(
    $del,$link)=explode('<a href="profile.php?id=',$asd[$i]);
    list(
    $links,$dels)=explode("ALT='' /></a>",$link);
    //
    list($no,$yes)=explode('">Друзья ',$asd[$i]);
    list(
    $ye,$nick)=explode("</a>",$yes);
    //
    list($id,$oth)=explode('"><IMG SRC=\'',$link);
    list(
    $link,$null)=explode("'",$oth);
    if(
    $id==""){}else{
    $url=parse_url($link);
    $p=explode('/',$link);
    list(
    $null,$zero,$kkk)=explode("/",$url['path']);
    if(
    is_file("img/".$id."_".$p[4])){$txt=$id.":".$kkk.":$ye:no\r\n";echo $txt;too($txt);}else{
    $fp=fopen("img/".$id."_".$p[4],"w");fwrite($fp,file_get_contents($link));
    $txt=$id.":".$kkk.":$ye:yes\r\n";$txts=$id.":".$kkk.":$ye<BR>";echo $txts;too($txt);
    }

    }
    }
    return 
    $null;
    }



    function 
    get_next($rss,$id,$email,$pass,$sex,$city)
    {
    $ggg="";
    $dates="GET http://vkontakte.ru/search.php?subm=1&act=adv&sex=".$sex."&uni_city=".$city."&o=0&st=".$rss." HTTP/1.0\r\n";
    $dates.="Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*\r\n";
    $dates.="Referer: http://vkontakte.ru/search.php?subm=1&act=adv&sex=1&uni_city=61&o=0&st=10\r\n";
    $dates.="Accept-Language: ru\r\n";
    $dates.="Proxy-Connection: Keep-Alive\r\n";
    $dates.="User-Agent: VKontakte.Ru Search[Version: 1.0 Beta]\r\n";
    $dates.="Host: vkontakte.ru\r\n";
    $dates.="Cookie: remixchk=5; remixmid=".$id."; remixemail=".$email.";remixpass=".$pass."\r\n";
    $dates.="\r\n";
    $fp fsockopen("vkontakte.ru"80$errno$errstr30);

    if (!
    $fp) {echo "$errstr ($errno)<br />\n";}else{ 
    fwrite($fp$dates);
    echo 
    feof($fp);
    while (!
    feof($fp)) {      $ggg.=fgets($fp128);  }}
    fclose($fp);
    return 
    $ggg;

    }
    function 
    too($txt){$fps=fopen("log.txt","ab");fwrite($fps,$txt);fclose($fps);}
    ?>
    Может кому пригодится...
    Парсит лог и можно посмотерть сколько и кого нашли с картинками.

    PHP:
      <?
      error_reporting 
    (E_ALL);
    $file=file("log.txt");
    for(
    $i=0$i count($file); $i++){
    list(
    $id,$img,$nick,$rep)=explode(":",$file[$i]);
    echo 
    "Id:$id($nick)<BR><IMG SRC='img/".$id."_".$img."'><BR>";

    echo 
    $file[$i];

    }
    echo 
    count($file);
      
    ?>
     
  2. Foxtrot1

    Foxtrot1 Elder - Старейшина

    Joined:
    27 Mar 2008
    Messages:
    0
    Likes Received:
    15
    Reputations:
    5
    им девок искать токо если, а спамер написать можешь?
     
  3. D0S

    D0S Elder - Старейшина

    Joined:
    6 Jan 2007
    Messages:
    44
    Likes Received:
    7
    Reputations:
    0
    -Hormold- тыб лучше серч по /audio.php замутил
     
  4. Foxtrot1

    Foxtrot1 Elder - Старейшина

    Joined:
    27 Mar 2008
    Messages:
    0
    Likes Received:
    15
    Reputations:
    5
    а этим скриптом набрать фотки девок можно да...
     
  5. CyberTm

    CyberTm Elder - Старейшина

    Joined:
    29 Oct 2007
    Messages:
    43
    Likes Received:
    3
    Reputations:
    0
    Выдает ошибку:
    Warning: fwrite(): supplied argument is not a valid stream resource in Z:\home\test1.ru\subdomain\made.php on line 21

    Warning: fclose(): supplied argument is not a valid stream resource in Z:\home\test1.ru\subdomain\made.php on line 22
    file/file152624.res
    Warning: file_get_contents(file/file152624.res) [function.file-get-contents]: failed to open stream: No such file or directory in Z:\home\test1.ru\subdomain\made.php on line 29
     
  6. Foxtrot1

    Foxtrot1 Elder - Старейшина

    Joined:
    27 Mar 2008
    Messages:
    0
    Likes Received:
    15
    Reputations:
    5
    на хостинг залей . хотя сам я его еще не тестил
     
  7. -Hormold-

    -Hormold- Кто, если не ты?

    Joined:
    29 Sep 2007
    Messages:
    418
    Likes Received:
    290
    Reputations:
    44
    создай папку res и img
    и дай права 777
     
  8. CyberTm

    CyberTm Elder - Старейшина

    Joined:
    29 Oct 2007
    Messages:
    43
    Likes Received:
    3
    Reputations:
    0
    Никак ... на ту1 не работает и на денвере не получается запустить
     
  9. -Hormold-

    -Hormold- Кто, если не ты?

    Joined:
    29 Sep 2007
    Messages:
    418
    Likes Received:
    290
    Reputations:
    44
    Ошибки есть?
     
  10. CyberTm

    CyberTm Elder - Старейшина

    Joined:
    29 Oct 2007
    Messages:
    43
    Likes Received:
    3
    Reputations:
    0
    Warning: fsockopen() has been disabled for security reasons in /home/tu1.ru/c/cy/cybertm/htdocs/www/made.php on line 73
    ()

    Warning: fclose(): supplied argument is not a valid stream resource in /home/tu1.ru/c/cy/cybertm/htdocs/www/made.php on line 79
    file/file1033467.res
    Warning: fsockopen() has been disabled for security reasons in /home/tu1.ru/c/cy/cybertm/htdocs/www/made.php on line 73
    ()
     
  11. Foxtrot1

    Foxtrot1 Elder - Старейшина

    Joined:
    27 Mar 2008
    Messages:
    0
    Likes Received:
    15
    Reputations:
    5
    в чем у тебя проблема то?
     
  12. -Hormold-

    -Hormold- Кто, если не ты?

    Joined:
    29 Sep 2007
    Messages:
    418
    Likes Received:
    290
    Reputations:
    44
    fsockopen - off
     
  13. Foxtrot1

    Foxtrot1 Elder - Старейшина

    Joined:
    27 Mar 2008
    Messages:
    0
    Likes Received:
    15
    Reputations:
    5
    сокеты
     
  14. CyberTm

    CyberTm Elder - Старейшина

    Joined:
    29 Oct 2007
    Messages:
    43
    Likes Received:
    3
    Reputations:
    0
    а на девере их че нету??
     
    #14 CyberTm, 13 Apr 2008
    Last edited: 13 Apr 2008
  15. Foxtrot1

    Foxtrot1 Elder - Старейшина

    Joined:
    27 Mar 2008
    Messages:
    0
    Likes Received:
    15
    Reputations:
    5
    а ты на хостинг пробовал залить?
     
    #15 Foxtrot1, 13 Apr 2008
    Last edited: 13 Apr 2008