in reply to Question: Fast way to validate 600K websites
Vary -N=nn to suit your bandwidth:
#! perl -slw use strict; use threads; use Thread::Queue; use LWP::Simple; our $N ||= 10; my $Q = new Thread::Queue; my @pool = map async{ print "$_ :", head( $_ ) ? 'ok' : 'not ok' while $_ = $Q->dequeue; }, 1 .. $N; while( <> ) { chomp; $Q->enqueue( $_ ); } $Q->enqueue( (undef) x $N ); $_->join for @pool; __END__ C:\test>headUrls.pl -N=20 urls.txt http://www.shops-gifts.shopiwon.com/ :not ok http://1ezbiz.leadsomatic.com :ok http://Indserve.com/kids :not ok http://16066.profitmatic.com :ok http://1-family.com/office/web/tp514/Boats.shtml :ok http://1mboard.proboards28.com/index.cgi :ok http://1plus-longdistance.com/domain/ :ok http://1stopsquare.com/101xyron.html :ok http://1world.leadsomatic.com :ok http://1stphoenix.veretekk.com/index.html :ok http://1stphoenix.veretekk.com :ok http://1bernard.veremail.com/index.html :ok
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Question: Fast way to validate 600K websites
by lihao (Monk) on May 12, 2008 at 19:35 UTC | |
by leocharre (Priest) on May 12, 2008 at 20:38 UTC | |
|
Re^2: Question: Fast way to validate 600K websites
by tachyon-II (Chaplain) on May 13, 2008 at 16:40 UTC | |
by BrowserUk (Patriarch) on May 13, 2008 at 17:50 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |