1x33x7

Toolstore Simple Date-Checker by Bloodman @ 2o12

Oct 13th, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2. ##################################################################
  3. ## ##
  4. ## Toolstore Simple Date-Checker by Bloodman @ 2o12 ##
  5. ## ##
  6. ##################################################################
  7. use LWP::Simple;
  8. use Term::ANSIColor;
  9.  
  10. open(OUTPUT, ">>result.txt"); ## In dieser Datei werden die Results gespeichert ##
  11. open(INPUT_SRV, "<server.txt"); ## In dieser Datei werden die Server die gechecked werden sollen eingetragen ##
  12. open(INPUT_CHK, "<check.txt"); ## DONT-CHANGE ##
  13.  
  14. system $^O eq 'MSWin32' ? 'cls' : 'clear';
  15.  
  16. my $start = time();
  17.  
  18. my(@urls) = <INPUT_SRV>;
  19. @urls = sort(@urls);
  20. my($url);
  21.  
  22. my(@files) = <INPUT_CHK>;
  23. @files = sort(@files);
  24. my($file);
  25.  
  26.  
  27. print <<ABOUT;
  28.  
  29. ##################################################################
  30. ## ##
  31. ## Toolstore Simple Date-Checker by Bloodman @ 2o12 ##
  32. ## ##
  33. ##################################################################
  34.  
  35. \n\n
  36. ABOUT
  37.  
  38. foreach $url (@urls)
  39. {
  40. foreach $file (@files)
  41. {
  42. chomp($url);
  43. $full_url = join "/", $url, $file;
  44.  
  45. $content = get($full_url);
  46. if ($content)
  47. {
  48. print color("green"), "Exists - $full_url", color("reset");
  49. print OUTPUT $full_url;
  50. }
  51. else
  52. {
  53. print color("red"), "Failed - $full_url", color("reset");
  54. }
  55. }
  56. }
  57.  
  58. my $finish = time();
  59. print "\n\nCheck takes: ", $finish-$start, " seconds\n";
  60.  
  61.  
  62. close(INPUT_SRV);
  63. close(INPUT_CHK);
  64. close(OUTPUT);
Advertisement
Add Comment
Please, Sign In to add comment