Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. #!/usr/bin/perl
  2. $|=1;
  3. $count = 0;
  4. $pid = $$;
  5. while (<>) {
  6. chomp $_;
  7. if ($_ =~ /(.*\.jpg)/i) {
  8. $url = $1;
  9. system("/usr/bin/wget", "-q", "-O","/var/www/images/$pid-$count.jpg", "$url");
  10. system("/usr/bin/mogrify", "-flip","/var/www/images/$pid-$count.jpg");
  11. print "http://127.0.0.1/images/$pid-$count.jpg\n";
  12. }
  13. elsif ($_ =~ /(.*\.gif)/i) {
  14. $url = $1;
  15. system("/usr/bin/wget", "-q", "-O","/var/www/images/$pid-$count.gif", "$url");
  16. system("/usr/bin/mogrify", "-flip","/var/www/images/$pid-$count.gif");
  17. print "http://127.0.0.1/images/$pid-$count.gif\n";
  18.  
  19. }
  20. elsif ($_ =~ /(.*\.png)/i) {
  21. $url = $1;
  22. system("/usr/bin/wget", "-q", "-O","/var/www/images/$pid-$count.png", "$url");
  23. system("/usr/bin/mogrify", "-flip","/var/www/images/$pid-$count.png");
  24. print "http://127.0.0.1/images/$pid-$count.png\n";
  25.  
  26. }
  27. else {
  28. print "$_\n";;
  29. }
  30. $count++;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement