Apr 8, 2015 12:43 PM
(This post was last modified: Jan 5, 2017 08:51 PM by Brasil.)
I made a program that you feed proxies like this:
and it checks them against GOOGLE. You can specify the timeout for each proxy. When it is done it prints out something like this: So you know that those two proxies worked, and that didn't work.
Linux
(can be done, but requires lots of effort)
Interpreting the source in windows is alot different, and this post is really targeted towards savvy linux users, not lazy windozers (sorry guys). That being said you can still interpret it in windows with something like activestate of strawberry perl. You can even compile it with PAR::Packer, but you don't need to.
Here is a link:
http://strawberryperl.com/
I am selling scrapers to go with this, as well as my own scraper-checker windows executables; that being said you are free to make your own scrapers or do pretty much whatever you want with the above code.
Code
1.1.1.1:1111
2.2.2.2:2222
3.3.3.3:3333
et ceteraCode
1.1.1.1:1111
3.3.3.3:3333Code
2.2.2.2:2222The code
Code
#!/usr/bin/perl
use LWP::UserAgent;
for(@ARGV) {
if($_ eq '-h' or $_ eq '--help') {
die "-h for help\n-t [seconds] for timeout of checks. Default 5 seconds\n-v for verbose output\n";
}
if($_ eq '-t') {
shift @ARGV; #get -t out of @ARGV
$timeout = shift @ARGV; #Get the number after it
}
if($_ eq '-v') {
shift @ARGV; #Get -v out of @ARGV
$verbose = 1;
}
}
$timeout = 5 unless(defined($timeout));
my $ua = LWP::UserAgent->new;
$ua->timeout($timeout);
my $google = 'https://www.google.com';
while(<STDIN>) { #Each input line looks like 1.1.1.1:1111
chomp($_);
$ua->proxy(['https', 'http', 'ftp'], "socks://$_");
$site = $ua->get($google);
print "Checking $_\n" if($verbose);
sleep($timeout);
if($site->content =~ /<!doctype html>/) {
print "$_\n";
print "Success\n" if($verbose);
} else {
print "Failed\n" if($verbose);
}
}Installation:
Linux
- Create file 'checker' you can: Code
user@box$ touch checker - chmod checker you can: Code
user@box$ chmod 755 checker - install LWP::UserAgent and LWP::Protocol::socks
Codeuser@box$ cpan LWP::UserAgent LWP::Protocol::socks - edit checker and put my source in there. Here is how to open gedit from command line, but you can use any basic text editor. DON'T USE A WORD PROCESSOR LIKE LIBRE OFFICE OR MS WORD! Code
user@box$ gedit checker - execute checker in CLI by feeding it proxies in the specified format. If you need a scraper I can hook you up with one, PM me. Here is how I do it with my scrapers (which are coded by me to output in the proper format.) If you don't know what that meant, it just pipes the output from scraper_name to checker and pipes the output of checker to tee which is a built in linux command that prints the piped input into a file AND your standard output. In other words, you see it on your screen and it goes into out_proxies.txt at the same time.Code
user@box$ ./scraper_name | ./checker -t 3 | tee out_proxies.txt
an alternative iswhich writes to out_proxies.txt and doesn't print anything to your screen. (I like to watch it, so tee is for me)Codeuser@box$ ./scraper_name | ./checker -t 3 > out_proxies.txt
(can be done, but requires lots of effort)
Interpreting the source in windows is alot different, and this post is really targeted towards savvy linux users, not lazy windozers (sorry guys). That being said you can still interpret it in windows with something like activestate of strawberry perl. You can even compile it with PAR::Packer, but you don't need to.
Here is a link:
http://strawberryperl.com/
I am selling scrapers to go with this, as well as my own scraper-checker windows executables; that being said you are free to make your own scrapers or do pretty much whatever you want with the above code.
don't fall for impersonators
no blackhat, stop asking
no blackhat, stop asking


