Нужно было найти человека. Написал скрипт ещё давно, но сейчас решил выложить. Скрипт граббит страницы с ВКонтакте и сохраняет их потом парсит и сохраняет фотки! Вот города: Вот код: 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, $errstr, 30); if (!$fp) {echo "$errstr ($errno)<br />\n";}else{ fwrite($fp, $dates); echo feof($fp); while (!feof($fp)) { $ggg.=fgets($fp, 128); }} 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); ?>
Выдает ошибку: 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
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 ()