Skip to content

Instantly share code, notes, and snippets.

@acotie
Created November 1, 2009 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acotie/223704 to your computer and use it in GitHub Desktop.
Save acotie/223704 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
$mech->agent("Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)");
$mech->add_header( 'Referer', "http://bijint.com/jp/" );
my $base_url = 'http://www.bijint.com/binan/img/clk/';
for my $h (0..23) {
for my $m (0..59) {
my $file_name = sprintf('%02d%02d.jpg', $h, $m);
my $image_url = $base_url . $file_name;
get_image($image_url, $file_name);
}
}
sub get_image {
my ($image_url, $file_name) = @_;
eval{
$mech->get($image_url);
$mech->save_content($file_name);
}
if ($@) || print $@;
}
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment