Twitter E-mail Gatherer

dor@tehexploa

Registered Member
Joined
Apr 25, 2009
Messages
95
Reaction score
26
I saw mention of a Twitter mass e-mail script in a thread tonight, and decided I would attempt to find it / make my own. This is almost my first PHP ...
... blah blah - click on reference link to see original thread in teh Lounge

I posted this in lounge already, but I think it is more appropriate here**.

This script is posted in the Jr. VIP section (I didn't know it was), and because of recent news (That was fast... hxxp://www.webpronews.com/topnews/2009/05/11/spammers-may-have-another-trick-in-twitter) I tried making my own.

After a few rough tries/posts and thanks to the help of ukescuba we found a good solution for gathering emails via Twitter:

Code:
<?php
//set # of pages to scrape - you can increase this...
//I found there were a max of 15 when searching manually
for($i=1; $i<15; $i++)
{

//set url to scrape
//if you can think of any other popular emails domains let us know!
$url = file_get_contents("http://search.twitter.com/search?&page=".$i."&q=gmail.com+OR+hotmail.com+OR+yahoo.com+OR+aol.com&rpp=100");


//clean content
$content = strip_tags($url);


// extract emails
preg_match_all("([a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|biz|info)\b)siU",$content,$emails);

ob_start();

for($x=0; $x < count($emails,1)-1; $x++)
{
	print $emails[0][$x] . ", ";
}
// next line creates a space between pages
print "\n";print "\n";

$output = ob_get_clean();

// write emails to a file
file_put_contents( 'emails.txt', file_get_contents('emailst.txt') . $output );

}
?>

**If admins are bent on keeping it only in the Junior VIP section then feel free to remove this thread.
 
Back
Top