- #!/usr/bin/perl
- #Coded by Torune [Bloodhound]
- #Email: torune [at] hotmail.com
- #Homepage: http://torune.126.com
- #Notice: For personal usage only, all right reserved
- use HTTP::Request::Common qw(GET);
- use LWP::UserAgent;
- open(LIST,"proxy.txt");
- @contents=<LIST>;
- close LIST;
- foreach $proxy (@contents){
- $ua = LWP::UserAgent->new;
- $ua->agent('Mozilla/5.0');
- $proxy = "http://".$proxy;
- $ua->proxy(http => $proxy );
- my $res = $ua->request(GET 'http://www.ad.com/adclick.asp?name=HellYa');
- print "\nGo go go......\n";
- if ($res->is_success) {
- print "Oh Yeah, babay!\n";
- }
- else {
- print "Error: " . $res->status_line . "\n";
- print "Bad happened:
- \tThis proxy server seems down,try a new one.";
- }
- }
- exit;
复制代码 上面这个保存为.pl,然后找一个perl编译器,自己找一些代理copy保存为proxy.txt,和这个程序放一起,然后运行这个程序就可以自动使用上面的代理连接指定的地址 |