facebook email scraper

highrider778

Make Money Online
Very Active Members
#1
#!/usr/bin/perl
use strict;
use WWW::Mechanize;
use HTTP::Cookies;
use Image::Magick;
use Shell qw[ocrad];

my $username = @ARGV[0];
my $password = @ARGV[1];
my $iurl;#temp var
my $id; #temp var
my $x; #temp var
my $uids="uids"; #path of uid list file
my $idlist="idlist"; #path of output file
my $size=35; #size of email image to download

my $mech = WWW::Mechanize->new();
my $image = Image::Magick->new();

$mech->cookie_jar(HTTP::Cookies->new());

#login
$mech->post("https://login.facebook.com/login.php?m&next=http://m.facebook.com/inbox",{email=>$username,pass=>$password});

#star processing uids
open(UIDS,$uids);
open(IDLS,">>$idlist");
foreach $id (<UIDS>)
{
chomp($id);
$mech->get("http://m.facebook.com/profile.php?id=".$id."&v=info&refid=17");
if(defined ($iurl=$mech->find_image( url_regex => qr/string_image.php/ )))
{
($iurl=$iurl->url_abs())=~s/8.7/$size/;
chomp($iurl);
$x = $image->Read($iurl);
$x = $image->Write(gamma=>0.3,colorspace=>'rgb',filename=>$id.".ppm");
print IDLS "$id,".ocrad("$id.ppm")."\n";
@$image = ();

}
else
{
print IDLS "$id,undefined\n";
}
}

close(UIDS);close(IDLS);


it still requires ocrad, and a couple of CPAN modules (WWW::Mechanize, Image::Magick)