Jump to content
Guest Kronzy

Twitter email extractor PHP code [PHP]

Recommended Posts

Guest Kronzy
* Twitter Email extractor v.1.2
*
* author: spikyy @ BlackHatWorld
* thx to weaselstomp and HTTP_REFERER
*/

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 Extractor v1.5</title>
</head><body bgcolor="#7DE3F9">
<center> <h1>Twitter Extractor v1.5</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 /><b>Extract Mode: </b><br /><select name="mode"> <option>Usernames</option><option>Emails</option> <option
selected="selected">Both</option> </select>
<br /><br /><input type="submit" value="Search" size="6">
</center></td><td width="33%" height="100%" valign="center" ><center>
<b>Are you using keywords ? </b><select name="keyword"> <option>no</option> <option selected="selected">yes</option> </select>
<br /><br /><textarea name="keywords" rows="10" cols="20">
keyword1
keyword2
</textarea></center></td>
<td width="33%" height="100%" valign="center" >
<center><b>Domain type:</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>
<b>Extract Mode:</b>
Usernames: extract usernames only, Emails: extract emails only, Both: crystal clear. <br />
<b>Domain type</b> is not used with Extract Mode "Usernames".
</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">';

$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['mode']) && $_POST['mode'] != "") { $mode = $_POST['mode'];

} else { $err = 1; $errn = $errn."\n Keyword option 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";}

$matches = "";
$ue_matches = "";

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++)
{
if($mode != "Usernames")
{
$file =
file_get_contents("http://search.twitter.com/search?page=".$i."&rpp=100&ands=".trim($key)."&ors=".$domainsvar."?=".$country);
}
else
{
$file = file_get_contents("http://search.twitter.com/search?page=".$i."&rpp=100&ands=".trim($key)."?=".$country);
}

$file_st = strip_tags($file);

if($mode != "Usernames")
{

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_st, $matches);
}
if($mode != "Emails")
{
preg_match_all("/<a href=\"http:\/\/twitter.com\/([A-z]*)\"/",$file,$ue_matches);
}
}
}
}
else
{
for($i=$start; $i <= $pagenr; $i++)
{
if($mode != "Usernames")
{
$file = file_get_contents("http://search.twitter.com/search?page=".$i."&rpp=100&ors=".$domainsvar."?=".$country);
}
else
{
$file = file_get_contents("http://search.twitter.com/search?page=".$i."&rpp=100&q=+a+OR+i+OR+e?=".$country);
}

$file_st = strip_tags($file);

if($mode != "Usernames")
{

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_st, $matches);
}
if($mode != "Emails")
{
preg_match_all("/<a href=\"http:\/\/twitter.com\/([A-z]*)\"/",$file,$ue_matches);
}
}
}

if($mode != "Emails")
{
$ue_matches[1] = array_unique($ue_matches[1]);
echo '<form><textarea id="twtUsernames" name="usernames" cols="40" rows="20">';
foreach($ue_matches[1] as $key => $mtt)
{
echo trim($mtt)."\n"; ob_flush(); flush();
}
echo '</textarea>';
}
if($mode != "Usernames")
{
$matches[0] = array_unique($matches[0]);
echo '<textarea id="twtEmails" name="emails" cols="40" rows="20">';
foreach($matches[0] as $key => $mtt)
{
echo trim($mtt)."\n"; ob_flush(); flush();
}
echo '</textarea>';
}
}
else
{
echo "Errors:".$errn;
}

echo '<br /><br /><br />';
if($mode!="Emails")
{
echo '<input type="button" value="Select Usernames" onClick="javascript:this.form.twtUsernames.focus();this.form.twtUsernames.select();">';
}
if($mode!="Usernames")
{
echo '<input type="button" value="Select Mails" onClick="javascript:this.form.twtEmails.focus();this.form.twtEmails.select();">';
};
echo '<br /><br /></form><font color="red" size="5"><b> DONE !!! </b></font><br /><br /></td></tr>
</table>
</body>
</html>';

} else {

echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Twitter Extractor v1.5</title>
</head>
<body bgcolor="#7DE3F9">
<center> <h1>Twitter Extractor v1.5</h1>
<br />
<table width="70%" height="70%" bgcolor="#BBEFFA" border="0">
<tr>
<td width="100%" height="100%" valign="center" align="center">
<br /><br />
<font color="red" size="40"><b>YOU BROKE DA MACH1NE !1!!1 </b></font>
</td></tr>
</table>
</body>
</html>';

}

?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...