Парсер мыл Yandex PHP

Discussion in 'PHP' started by BAGA4, 27 Jan 2011.

  1. BAGA4

    BAGA4 New Member

    Joined:
    17 Nov 2010
    Messages:
    26
    Likes Received:
    1
    Reputations:
    0
    Возможно ли сделать такойже токо на PHP
    http://forum.antichat.ru/thread251272.html
    Мож у когото есть скрипты зарание благодарю!
     
  2. Hack_ERR++

    Hack_ERR++ Member

    Joined:
    13 Aug 2009
    Messages:
    41
    Likes Received:
    9
    Reputations:
    0
    Code:
    <?
    $text = file_get_contents('http://otvet.mail.ru/'); //откуда грабить мейлы
    preg_match_all("/[a-zA-z0-9]{1,}[@][a-zA-z0-9]*[.][a-zA-z0-9]*/",$text,$result);
    $res = array_unique($result[0]);
    $a = count($res);
    for ($i=0;$i<$a;$i++)
    {
    if ($res[$i]==true)
    {
    $f = fopen("ololo.txt", "a+");
    fputs($f,$res[$i]);
    fputs($f,"\r\n");
    fclose($f);
    }
    }
    ?>
    
    Может сгодится
     
  3. denbar

    denbar New Member

    Joined:
    28 Jun 2010
    Messages:
    122
    Likes Received:
    4
    Reputations:
    -7
    Hack_ERR++,Парсер мыл Yandex , а не
     
  4. Tw!m4

    Tw!m4 Elder - Старейшина

    Joined:
    15 Jun 2007
    Messages:
    187
    Likes Received:
    19
    Reputations:
    0
    Тут парсятся линки юзеров, которые и являются именами ихних мыл (думаю я ясно выразился? Оо), как я понял и делается это примерно так:

    Создайте файл "yandex_club.txt" и кидайте туда сылки такого плана:

    Code:
    http://clubs.ya.ru/noob/
    http://clubs.ya.ru/photo/
    http://clubs.ya.ru/photoshop/
    и смотрите, что б после последнего линка не было переноса строки!

    Code:
    <?php
    header('Content-type:text/html;charset=utf-8');
    
    $path = "tmp";
    if(is_dir($path)){
    	echo "All tmp file are in $path folder; <br />";
    }
    else{
    	echo "Creating path: $path ...";
    	mkdir($path, 0770);
    	echo " done <br />";
    }
    $links = "yandex_club.txt";
    $users_tmp = "$path/yandex_users_tmp.txt";
    $users_mail = "$path/yandex_users.txt";
    $tmp_file = "$path/yandex_code_tmp.htm";
    $mails = "mail.txt";
    
    $fp = file_get_contents($links);
    $exp_links = explode("\r\n", $fp);
    
    	foreach($exp_links as $link){
    		$open = file_get_contents($link);
    		
    		file_put_contents($tmp_file,$open);
    		$open_tmp = file_get_contents($tmp_file);
    		
    		preg_match_all('#<span class="b-yauser"><a href="http://(.+?).ya.ru/">#is',$open_tmp,$users);
    		
    		foreach($users as $key => $value){
    			$sorted_u = array_unique($value);
    			$users_impl = implode("\r\n",$sorted_u);
    			file_put_contents($users_tmp,"\r\n" . $users_impl);
    		}
    		$f_g_u_tmp = file_get_contents($users_tmp);		
    		file_put_contents($users_mail,$f_g_u_tmp,FILE_APPEND);
    
    	}
     	$g_u_m_file = trim(file_get_contents($users_mail), "\r\n");
    	$exp_u_m = explode("\r\n",$g_u_m_file);
    	
    		foreach($exp_u_m as $us_mail){
    			$sorted_f = array_unique($exp_u_m);
    			$foundstr = "Found:\t";
    			$yandex = "@yandex.ru";
    			$break_line = "\r\n";
    			
    			file_put_contents($mails,$foundstr.$us_mail.$yandex.$break_line,FILE_APPEND);
    		}
    	
    		
     	echo "Вывод" . "<br />" . "<hr />";
    	$expl_strokes = explode("\r\n", file_get_contents($mails));
    	$sorted = array_unique($expl_strokes);
    	foreach($sorted as $stroke){
    		echo $stroke . "<br />";
    	}
    ?>
    вывод из файла в браузер. Если я не прав, подправте!
     
  5. De-visible

    De-visible [NDC] Network develope c0ders

    Joined:
    6 Jan 2008
    Messages:
    916
    Likes Received:
    550
    Reputations:
    66
    "".replace("\n","") ?
     
  6. Tw!m4

    Tw!m4 Elder - Старейшина

    Joined:
    15 Jun 2007
    Messages:
    187
    Likes Received:
    19
    Reputations:
    0
    А как сделать, что б только для последней строчки это было использовано?
     
  7. SQLHACK

    SQLHACK Остались только слоны

    Joined:
    27 Sep 2006
    Messages:
    437
    Likes Received:
    372
    Reputations:
    407
    foreach($exp_links as $link){
    заменить на
    foreach($exp_links as $link){
    if(trim($link) == "") continue;

    можно так
     
    _________________________
  8. -=Zhenek=-

    -=Zhenek=- Elder - Старейшина

    Joined:
    31 Dec 2007
    Messages:
    271
    Likes Received:
    77
    Reputations:
    1
    offtop:

    Там мыла уже изъезженные. Я заказывал многопоточную парсилку пол года назад с GUI, сам отспамил что мне было нужно, а потом собирал мыла и в базы в паблик выкладывал