Twitter Email Extractor Script

revit

BANNED
Joined
Apr 24, 2009
Messages
266
Reaction score
372
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:

 
revit you are posting very useful stuff lets see if i can get us leads with this
 
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>';
}
?>
 
change the search criteria. In the current search i believe there are only 2 pages in twitter.
 
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/
 
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
 
i dunno how to get it to work.....

i uploaded it,and see what i got....

Code:
http://appleinsider.info/bally/twitter.php

How to get more emails?


When i refresh the page,most of the emails get repeated.

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. :-)
 
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/

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
 
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>';
?>
 
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

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.
 
Guys, could anyone try to elaborate how to use the
script (extract email from twitter) and install it in a PC.
coz most of the people here don't know how to use the script.
my 2 grand...

I see you are about to be busted for spam :D
Are you ready to live in prison???
 
spammers will be punished anyway. this is not my opinion - this is a fact
 
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
 
i think this script can be tweaked better way.....i am also getting maximum execution time error.
 
Last edited:
Back
Top