Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

perl : batch image get for 4chan

Name: kumo 2012-05-17 20:55

#!/usr/bin/perl
#2012-0517-2030
use WWW::Mechanize;
sub bash {my @args = ( "bash", "-c", shift); system(@args);}

my $url = $ARGV[0];
my $prefix = "(.*)//images.4chan.org/(.*)/src/(.*)";

my $mech = WWW::Mechanize->new();
$mech->get( $url );
my @links = $mech->links();

foreach my $link (@links) {
        my $_ = $link->url();
        if ($_ =~ (m/$prefix/)) {
                s!//!http://!;
                if ($_ ne $last_url) {bash("wget -nc $_");}
                $last_url = $_;
}       }

Name: Anonymous 2012-05-17 21:33

>>1
bash("wget -nc $_");
use IO::Socket or die;

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List