1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Twitter Email Extractor Script

Discussion in 'Black Hat SEO Tools' started by revit, Jul 10, 2009.

  1. revit

    revit BANNED BANNED

    Joined:
    Apr 24, 2009
    Messages:
    266
    Likes Received:
    370
    Here's a nice little php Twitter Email Extractor for everyone :)


    HTML:
    
    <?php
    $file = file_get_contents("http://search.twitter.com/search?q=gmail.com+OR+yahoo.com+OR+msn.com+OR+aol.com+OR+hotmail.com++OR+%22email+me%22+OR+%22contact+me%22");
    $file = strip_tags($file);
     
    preg_match_all(
        "([a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)\b)siU",
        $file,
        $matches);
     
    echo '<pre>';
    print_r($matches);
    echo '</pre>';
    ?>
    
    
    


    The Output looks like this:

    HTML:
    
                [0] => protein324@aol.com
                [1] => tendaijoe@gmail.com
                [2] => primozlpartenon@hotmail.com
                [3] => budgetamit@gmail.com
                [4] => parisstanback@tmail.com
                [5] => michaellhobart@gmail.com
                [6] => iwanttobuyamelon@gmail.com
                [7] => lordejorge@hotmail.com
    
    
     
    • Thanks Thanks x 11
  2. mmguru770

    mmguru770 Regular Member

    Joined:
    Mar 19, 2009
    Messages:
    221
    Likes Received:
    508
    revit you are posting very useful stuff lets see if i can get us leads with this
     
  3. raicha101

    raicha101 Junior Member

    Joined:
    Mar 27, 2009
    Messages:
    112
    Likes Received:
    27
    Thanks for regex
     
  4. weaselstomp

    weaselstomp Registered Member

    Joined:
    Oct 29, 2008
    Messages:
    86
    Likes Received:
    450
    Location:
    Florida
    Home Page:
    I made a few quick sloppy changes to this below. To config:

    -$max_results is the number of results PER PAGE, not total. Twitter caps this at 100
    -$max_pages is implemented because of Twitter's pagination. Set the number of pages you'd like it to search through.
    -$use_keywords is set to false by default, for use with the next option:
    -$keywords should be separated by pluses (+) not spaces. I tried with a few different keyword combos, didn't find much. Of course, this script only checks to see if that keyword is in the same tweet as the email address, not the users entire history.

    Code:
    <?php
    /************Settings*****************************/
    /*set max number of results per page (max is 100)*/
    $max_results = 100;
    /*set number of pages to recurse through */
    $max_pages = 2;
    /* use keywords? */
    $use_keywords = false;
    /*add a keyword or two separate by +'s 
    	for example this will work: $keywords="make+money";
    	but this will not: $keywords="make money";
    */
    $keywords="hello";
    
    
    
    /************Loopage*****************************/
    for ($i = 1; $i <= $max_pages; $i++) {
    if (!$use_keywords) {
    		$keywords = "";
    } 
    $file = file_get_contents("http://search.twitter.com/search?page=".$i."&rpp=".$max_results."&ands=".$keywords."&ors=gmail.com+yahoo.com+msn.com+aol.com+hotmail.com&lang=en");
    $file = strip_tags($file);
     
    preg_match_all("([a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)\b)siU", $file, $matches);
    
    
    echo '<pre>';
    echo 'Page '.$i.' - Keyword(s): '.$keywords.':<br>';
    print_r($matches);
    echo '</pre>';
    }
    ?>
    
    
     
    • Thanks Thanks x 7
  5. weaselstomp

    weaselstomp Registered Member

    Joined:
    Oct 29, 2008
    Messages:
    86
    Likes Received:
    450
    Location:
    Florida
    Home Page:
    Oh, and it returns English-only Twitterers. If you want to return any language, change "&lang=en" to just "&lang="

    Or, if you want to target a specific language:

    ar=Arabic (&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;)
    da=Danish (dansk)
    nl=Dutch (Nederlands)
    en=English
    fa=Farsi / Persian (&#1601;&#1575;&#1585;&#1587;&#1740;)
    fi=Finnish (suomen kieli)
    fr=French (français)
    de=German (Deutsch)
    hu=Hungarian (Magyar)
    is=Icelandic (Íslenska)
    it=Italian (Italiano)
    ja=Japanese (&#26085;&#26412;&#35486;)
    no=Norwegian (Norsk)
    pl=Polish (polski)
    pt=Portuguese (Português)
    ru=Russian (&#1088;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081; &#1103;&#1079;&#1099;&#1082;)
    es=Spanish (español)
    sv=Swedish (Svenska)
    th=Thai (&#3652;&#3607;&#3618;)
     
  6. revit

    revit BANNED BANNED

    Joined:
    Apr 24, 2009
    Messages:
    266
    Likes Received:
    370
    change the search criteria. In the current search i believe there are only 2 pages in twitter.
     
  7. CasinoJack

    CasinoJack BANNED BANNED

    Joined:
    Jan 17, 2009
    Messages:
    711
    Likes Received:
    1,418
    Dude

    again you steal others work and make it as your own. This is twice you did so baltantly. At least say you found it and want to share it, we all knwo u did not code these

    http://www.fromzerotoseo.com/twitter-email-grabber/
     
  8. weaselstomp

    weaselstomp Registered Member

    Joined:
    Oct 29, 2008
    Messages:
    86
    Likes Received:
    450
    Location:
    Florida
    Home Page:
    Hmm. That is what it looks like, but Revit didn't say he coded it. Nice of him to share it anyway. I did add the modifications by hand however :)
     
  9. revit

    revit BANNED BANNED

    Joined:
    Apr 24, 2009
    Messages:
    266
    Likes Received:
    370
    What the! come on now, I just found and thought it was a cool script. What's your deal pal! Again, say thank you for posting the script or move on, why bring negativity on something good.

    Some people...I tell you what
     
  10. weaselstomp

    weaselstomp Registered Member

    Joined:
    Oct 29, 2008
    Messages:
    86
    Likes Received:
    450
    Location:
    Florida
    Home Page:
    To get more emails: As Revit said, you might want to change $max_pages to a higher number.

    Duplicates: Do a little research :) the PHP function array_unique should help. Or, if you're dumping them into an SQL database, just make whatever column you're pushing them into force unique values. :)
     
    • Thanks Thanks x 1
  11. revit

    revit BANNED BANNED

    Joined:
    Apr 24, 2009
    Messages:
    266
    Likes Received:
    370
    Your complaining that I shared a code that someone else made and yet I don't see you complaining when someone shares a nulled script/program.

    Your in a blackhat forum buddy!

    LOL...did I bash one of your recent posts or something or are you just having a bad day and need to release some tension?


    ....Amusing
     
  12. revit

    revit BANNED BANNED

    Joined:
    Apr 24, 2009
    Messages:
    266
    Likes Received:
    370
    If you want to grab just the usernames:

    lol...does this make you feel better CasinoJack?


    HTML:
    
    <?php
    $file = file_get_contents("http://search.twitter.com/search?q=gmail.com+OR+hotmail.com++OR+%22email+me%22");
     
    preg_match_all(
        "/<a href=\"http:\/\/twitter.com\/([A-z]*)\"/",
        $file,
        $matches);
     
    echo '<pre>';
    print_r(array_unique($matches[1]));
    echo '</pre>';
    ?>
    
    
     
  13. revit

    revit BANNED BANNED

    Joined:
    Apr 24, 2009
    Messages:
    266
    Likes Received:
    370
    And then once you have those screennames, then you can plug them into this script:

    Demo:
    HTML:
    http://demo.marcofolio.net/mass_twitter_script/
    Download:
    HTML:
    http://www.mediafire.com/download.php?mzlzmyldyif
     
    • Thanks Thanks x 4
  14. blackhat+er

    blackhat+er Regular Member

    Joined:
    Feb 19, 2009
    Messages:
    217
    Likes Received:
    150
    I dont think it has anything to do with a bad day I just think that its the fact you keep posting code and not distinguishing where it came from which if you have ever written code then you want the respect of leaving the commented copywrite in the code as well as just say where you got it or who's it is instead of leaving it to asuming and trying to build up your pathetic little thank you's off shares that aren't yours. The only reason I choose to say anything is that its annoying being a coder myself to see my shit shared with copywrite yanked out and people trying to pass it as if they did it or can hang. Anyways reguardless of who actually coded it, its a decent share so your thank you, you so preciously wanted was given.
     
  15. raicha101

    raicha101 Junior Member

    Joined:
    Mar 27, 2009
    Messages:
    112
    Likes Received:
    27
    Most easy way to scrape twitter emails would be use google
    search for "@gmail.com" site:twitter.com (Only last 24 hours) everyday. Your DP will grow over time
     
    • Thanks Thanks x 6
  16. Panique

    Panique Power Member

    Joined:
    Sep 21, 2008
    Messages:
    589
    Likes Received:
    412
    Location:
    Caribbean Islands
    Home Page:
    hmm nice one, will test this out
     
  17. furiouz

    furiouz Power Member

    Joined:
    Apr 24, 2009
    Messages:
    507
    Likes Received:
    123
    I see you are about to be busted for spam :D
    Are you ready to live in prison???
     
  18. furiouz

    furiouz Power Member

    Joined:
    Apr 24, 2009
    Messages:
    507
    Likes Received:
    123
    spammers will be punished anyway. this is not my opinion - this is a fact
     
  19. spikyy

    spikyy Junior Member

    Joined:
    Jul 27, 2008
    Messages:
    187
    Likes Received:
    213
    I updated the twitter extractor script here it is

    Code:
    <?php
    /*************************
    *
    * Twitter Email extractor v.1
    *
    * author: spikyy @ BlackHatWorld
    */
      
    if(!isset($_GET['action'])) {
          
          $file = $_SERVER["SCRIPT_NAME"];
          $break = Explode('/', $file);
          $pfile = $break[count($break) - 1]; 
          
          print_r('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html><head><title>Twitter Email Extractor</title>
    </head><body bgcolor="#7DE3F9">
    <center> <h1>Twitter Extractor v.1</h1> <br />
    <form action="'.$pfile.'?action=do" method="post">
    <table width="70%" height="70%" bgcolor="#BBEFFA" border="0">
    <tr> <td width="33%" height="100%" valign="center" align="left" >
    <center><b> How many Twitter pages: </b> <br /><br />
    <input name="pagenr" type="text" size="2" value="10">
    <br /><br /><b>Tweple country:</b><br /> (English = en, Spanish = es)
    <br /><br /><input type="text" name="country" value="en" size="2">
    <br /><br /> <br /><input type="submit" value="Search for Emails!" size="6">
    </center></td><td width="33%" height="100%" valign="center" ><center>
    <b>Are you using keywords ? </b><select name="keyword"> <option>yes</option> <option selected="selected">no</option>  </select>
    <br /><br /><textarea name="keywords" rows="10" cols="20">
    keyword1
    keyword2
    keyword3</textarea></center></td>
    <td width="33%" height="100%" valign="center" >
    <center><b>Domain type for searching:</b><br /><br />
    <textarea name="domains" rows="10" cols="20">
    gmail.com
    yahoo.com
    msn.com
    aol.com
    hotmail.com</textarea></center></td>
    </tr></table></form></center> </body></html>
    ');
          
      } else {
          
    print_r('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>Twitter Email Extractor</title>  
    </head>
    <body bgcolor="#7DE3F9">
    <center> <h1>Twitter Extractor v.1</h1> 
    <br />
    <table width="70%" height="70%" bgcolor="#BBEFFA" border="0">
    <tr> 
    <td width="100%" height="100%" valign="center" align="center">
    <b>Extracting ... </b><br /><br />
    <textarea cols="30" rows="20">');
      
      $err = 0;
          
      if(isset($_POST['pagenr']) && $_POST['pagenr'] != "") { $pagenr = $_POST['pagenr'];
     
      } else { $err = 1; $errn = $errn."\n Number of pages is missing"; }
      
      if(isset($_POST['country']) && $_POST['country'] != "") { $country = $_POST['country']; 
      
      } else { $err = 1; $errn = $errn."\n Country is missing"; }
      
      if(isset($_POST['keyword']) && $_POST['keyword'] != "") { $keyword = $_POST['keyword']; 
      
      } else { $err = 1; $errn = $errn."\n Keyword option is missing"; }
      
      if($keyword == "yes") { if(isset($_POST['keywords']) && $_POST['keywords'] != "") { $keywords = $_POST['keywords']; 
      
      } else { $err = 1; $errn = $errn."\n Keywords missing"; } }
      
      if(isset($_POST['domains']) && $_POST['domains'] != "") {$domains = $_POST['domains']; 
      
      } else { $err = 1; $errn = $errn."\n Domains missing"; }
      
      if($err == 0)     { 
      
         $domains = nl2br($domains);
         $domains = explode('<br />', $domains);
         foreach($domains as $dd)
         {
           $domainsvar = $domainsvar.trim($dd)."+";   
         }
         $domainsvar = strrev(substr(strrev($domainsvar), 1));
         if($keyword == "yes") {
          
          $keywords = nl2br($keywords);
          $keywords = explode('<br />', $keywords); 
               
         foreach($keywords as $key) {
             
         for($i=1; $i <= $pagenr; $i++) {
         
         $file = file_get_contents("http://search.twitter.com/search?page=".$i."&rpp=100&ands=".trim($key)."&ors=".$domainsvar."&lang=".$country);
         $file = strip_tags($file);
     
         $matches = "";
         
         preg_match_all("([a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)\b)siU", $file, $matches);
         
         foreach($matches[0] as $mtt) {        
             echo trim($mtt)."\n"; ob_flush(); flush();
         }        
             
             
         }  }   }  else {
             
         for($i=1; $i <= $pagenr; $i++) {
         
         $file = file_get_contents("http://search.twitter.com/search?page=".$i."&rpp=100&ors=".$domainsvar."&lang=".$country);
         $file = strip_tags($file);
         
         $matches = ""; 
     
         preg_match_all("([a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)\b)siU", $file, $matches);
         
         foreach($matches[0] as $mtt) {        
             echo trim($mtt)."\n";ob_flush();flush();}         
             }
         
         
         }        
    
      
      } else {
          
          echo "Errors:".$errn;
      
      } 
      
       
      print_r('</textarea>
    <br /><br />
    <font color="red" size="5"><b> DONE !!! </b></font>
    </td></tr>  
    </body>
    </html>'); 
          
          
      }
      
      
      
      
      
      
    ?>
    Also available at http://pastie.org/542433
     
    • Thanks Thanks x 2
  20. blackhaty

    blackhaty Junior Member

    Joined:
    Feb 24, 2008
    Messages:
    125
    Likes Received:
    50
    i think this script can be tweaked better way.....i am also getting maximum execution time error.
     
    Last edited: Jul 11, 2009