/ Published in: Perl
source for perl file that is step 2
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/usr/bin/perl use HTTP::Request; my $pua = LWP::Parallel::UserAgent->new(); $pua->in_order (1); # handle requests in order of registration $pua->duplicates(0); # ignore duplicates $pua->timeout (8); # in seconds $pua->redirect (1); # follow redirects $pua->max_hosts(5); # sets maximum number of locations accessed in parallel $pua->max_req (5); # sets maximum number of parallel requests per host my(@reqs) = <>; # read input file from step 1 foreach my $req (@reqs) { # print "Registering $req \n"; if ( my $res = $pua->register (HTTP::Request->new('GET', $req) ) ) { } } my $res = $entries->{$_}->response; $res->message,"\n"; }