Advertisement
Guest User

divi

a guest
Jun 13th, 2008
607
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.32 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.         system("/bin/chmod", "777","/var/www/images/$pid-$count.jpg");
  12.                 print "http://192.168.0.30/images/$pid-$count.jpg\n";
  13.         }
  14.         elsif ($_ =~ /(.*\.png)/i) {
  15.                 $url = $1;
  16.                 system("/usr/bin/wget", "-q", "-O","/var/www/images/$pid-$count.png", "$url");
  17.                 system("/usr/bin/mogrify", "-flip","/var/www/images/$pid-$count.png");     
  18.         system("/bin/chmod", "777","/var/www/images/$pid-$count.png");
  19.                 print "http://192.168.0.30/images/$pid-$count.png\n";
  20.         }
  21.         elsif ($_ =~ /(.*\.gif)/i) {
  22.                 $url = $1;
  23.                 system("/usr/bin/wget", "-q", "-O","/var/www/images/$pid-$count.gif", "$url");
  24.                 system("/usr/bin/mogrify", "-flip","/var/www/images/$pid-$count.gif");     
  25.         system("/bin/chmod", "777","/var/www/images/$pid-$count.gif");
  26.                 print "http://192.168.0.30/images/$pid-$count.gif\n";
  27.         }
  28.         else {
  29.                 print "$_\n";;
  30.         }
  31.         $count++;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement