Was ist neu?
Digital Marketing & Webmaster Forum

Digital Marketing, Internet-Technologien, Metaverse und mehr interessieren Dich? Registriere Dich gleich kostenlos, um Mitglied zu werden! Sobald Du angemeldet bist, kannst Du loslegen, Themen und Beiträge veröffentlichen und mit anderen Mitgliedern in Kontakt treten! Wir wünschen Dir einen anregenden Austausch!

Twitter Email Grabber

SeoPunk

- Royal Clan Member -
Dieses PHP Script welches ich im Netz gefunden habe könnt ihr benutzen um auf Twitter Emailadressen herauszuziehen. Ich habe es auf meinem localhost getestet und es funktioniert wunderbar ;)

PHP:
<?php
/*************************
*/

set_time_limit(1800); // 30 minutes

$break = Explode('/', $_SERVER["SCRIPT_NAME"]);
$pfile = $break[count($break) - 1]; 
  
if(!isset($_GET['action'])) {
      

      
      echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Twitter Email Extractor</title>
</head><body bgcolor="#7DE3F9">
<center> <h1>Twitter Email Extractor</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> Starting page: </b><br />
<input name="start" type="text" size="2" value="1"><br /> <br />
<b> How many Twitter pages: </b><br />
<input name="pagenr" type="text" size="2" value="10">
<br /><br /><b>Tweple country:</b><br /> (English = en, Spanish = es)
<br /><input type="text" name="country" value="en" size="2">
<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 if (isset($_GET['action']) && $_GET['action'] == "do") {
      
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Twitter Email Extractor</title>  
</head>
<body bgcolor="#7DE3F9">
<center> <h1>Twitter Email Extractor</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 />
<form action="'.$pfile.'?action=remove" method="POST">
<textarea name="emails" 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(isset($_POST['start'])) { $start = $_POST['start'];
  
  } else { $err=1; $errn = $errn."\n Starting page 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=$start; $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=$start; $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;
  
  } 
  
   
  echo '</textarea>
<br /><br />
<font color="red" size="5"><b> DONE !!! </b></font>
 <br /><br /> <input type="submit" value="Remove duplicates!">
</td></tr>
</table> 
</body>
</html>'; 
      
      
  }  else {
      
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Twitter Email Extractor</title>  
</head>
<body bgcolor="#7DE3F9">
<center> <h1>Twitter Email Extractor</h1> 
<br />
<table width="70%" height="70%" bgcolor="#BBEFFA" border="0">
<tr> 
<td width="100%" height="100%" valign="center" align="center">
<br /><br /> <form>
<textarea id="twtResults" name="emails" cols="30" rows="20">';
      
   if(isset($_POST['emails'])) {
       
       $emails = $_POST['emails'];
       
       $emails = nl2br($emails);
       
       $emails = explode('<br />', $emails);
       
       $list = "....";
       
       foreach($emails as $em) {
           
            if(trim($em) != '') { if(!strstr($list, trim($em)))  {
                
                echo stripslashes(trim($em))."\n";
                $list = $list." ".trim($em); 
            }
       } }    
       
   } else { echo "Emails missing"; }

  echo '</textarea>
<br /><input type="button" value="Select Text" onClick="javascript:this.form.twtResults.focus();this.form.twtResults.select();">
<br /><br />  </form>
<font color="red" size="5"><b> DONE !!! </b></font>
</td></tr>
</table> 
</body>
</html>';

}
  
?>
 
Oben