Advertisement
dHeinemann

SpaceInvaderTurbo.pl

Mar 19th, 2011
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.86 KB | None | 0 0
  1. #!/usr/bin/perl
  2. #SpaceInvaderTurbo.pl
  3. #Revised version of SpaceInvader2.pl with 1000* more Wget.
  4. #This will create a separate Wget process for every line in your Hotlist at the expense of CPU.
  5. #Keep an eye on your computer and make sure you don't break it.  This comes with NO warranty.
  6. use strict;
  7. use warnings;
  8. use threads;
  9.  
  10. die("Usage: SpaceInvader2.pl \"HOTLIST\"\n") unless ($ARGV[0]);
  11.  
  12. open(HOTLIST, "<$ARGV[0]");
  13.  
  14. while (<HOTLIST>)
  15. {
  16.     my $pid;
  17.     next if $pid = fork;
  18.     die "fork failed: $!" unless defined $pid;
  19.  
  20.     &archiveSpace($_, 0);
  21.     exit;
  22. }
  23.  
  24. close(HOTLIST);
  25.  
  26. sub archiveSpace()
  27. {
  28.     exec("wget --mirror --page-requisites --continue --convert-links --user-agent=\"Googlebot/2.1 (+ http://www.googlebot.com/bot.html)\" -e robots=off --timestamping --wait $_[1] $_[0]");
  29. }
  30.  
  31. 1 while (wait() != -1);
  32. print("\n");
  33. print("$ARGV[0] done.\n");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement