Guest User

Untitled

a guest
Feb 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.35 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use LWP::Simple;
  5.  
  6. my $page = get($ARGV[0]) or die "unable to get page\n";
  7. my @images = ( $page =~ /http:\/\/images\.4chan\.org\/wg\/src\/\d+\.jpg/g );
  8.  
  9. foreach (uniq(@images)){
  10.     $_ =~ /(\d+\.jpg)/;
  11.     unless (-e $1){
  12.         system("wget $_");
  13.     }
  14. }
  15. sub uniq {
  16.     return keys %{{ map { $_ => 1 } @_ }};
  17. }
Add Comment
Please, Sign In to add comment