วันอังคารที่ 20 ธันวาคม พ.ศ. 2554

[Perl] Search free anonymous proxy

#[Perl] Search free anonymous proxy
#Pastebin : http://pastebin.com/eqTWiNTz


#For : หาพร๊อกซี่ไว้ใช้งานฟรีๆละครับ แต่ลิสต์พร๊อกซี่ที่ได้ ก็ยังใช้ไม่ 100% เลย TT แต่ก็ยังดีว้า

use LWP::UserAgent;
$agent=LWP::UserAgent->new;
$agent->agent('Mozilla/8.0');
$agent->max_redirect(0);
$agent->timeout(5);

$content=$agent->get('http://www.proxylists.net/http.txt')->content;
print 'Checking http://www.proxylists.net/http.txt...';
print "\n";
$content=~s/\r//g;
open FILE,">proxylists.net_http.txt";
print FILE $content;
close FILE;

$content=$agent->get('http://www.proxylists.net/http_highanon.txt')->content;
print 'Checking http://www.proxylists.net/http_highanon.txt...';
print "\n";
$content=~s/\r//g;
open FILE,">proxylists.net_http_highanon.txt";
print FILE $content;
close FILE;

open PROXY,"proxylists.net_http.txt";
@proxy=;
close PROXY;

open PROXY,"proxylists.net_http_highanon.txt";
push(@proxy,);
close PROXY;

print 'Found all proxy... ',scalar(@proxy),"\n\n";;

foreach $z (@proxy) {
chomp($z);
($ip,$port)=split(/:/,$z);
$agent->proxy(['http'], 'http://'.$z.'/');
$content=$agent->get('http://www.opkwin.com/whatismyip.php')->content;
if ($content=~/^500/) {
print "$z Noop !!!\n";
}
elsif ($content=~/$ip/) {
print "$z Is OK...\n";
open(LOG,">>proxylists.net_available.txt");
print LOG "$z\n";
close(LOG);
}
else {
print "$z ERROR : $content\n";
}
}

#Search free proxy !!
#http://comfreedom.blogspot.com

วันพุธที่ 14 ธันวาคม พ.ศ. 2554

[Perl] Facebook photo album download with perl

#[Perl] Facebook photo album download with perl
#Pastebin : http://pastebin.com/MRx8fGuV

#Usage : ' perl filename.pl username password album_url '


use LWP::UserAgent;

use HTTP::Cookies;

$user=(shift or 'email@fb_download.com');
$pass=(shift or 'password');
$album=(shift or 'http://www.facebook.com/media/set/?set=a.529237716211.2047231.4&type=3');

$cookie_jar=HTTP::Cookies->new(autosave=>1, hide_cookie2=>1);
$agent=LWP::UserAgent->new(
agent => 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16',
timeout => 5,
max_redirect => 0,
cookie_jar => $cookie_jar
);
$login=$agent->get('http://www.facebook.com/login.php');
$login=$agent->post('https://www.facebook.com/login.php',
[
'locale' => 'en_US',
'email' => $user,
'pass' => $pass,
'persistent' => 1
]
)->content;

if ($login!~/Incorrect Email|Incorrect username|Please re-enter your password|Cookies Required/i) {
print "Login success...\n";
$album_content=$agent->get($album)->content;
while ($album_content=~/src=(http(.+?).jpg)&/ig) {
print url_decode($1),"\n";
save(url_decode($1));
}
}
else { print "Login failed!!\n"; }


sub url_decode {
my $str=shift;
$str=~s/\%([A-Fa-f0-9]{2})/pack('C', hex($1))/seg;
return $str;
}
sub url_encode {
my $str=shift;
$str=~s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
return $str;
}
sub save {
$image=shift;
open TXT,">>FB_ablum_download.txt";
print TXT localtime." $image\n";
close TXT;

$saveimage=$agent->get($image)->content;
$image=~s/http:\/\/(.+)\///g;
open IMAGE,">$image";
binmode IMAGE;
print IMAGE $saveimage;
close IMAGE;
}

ฟู่วว ว์..