diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2010-05-20 22:19:17 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2010-05-20 22:19:17 +0200 |
commit | 44459767caf31fee8f92bff6f606e9bc403d50d6 (patch) | |
tree | 53c8160cc548fa34d5692d89e92d78265e19db2d | |
parent | 460fd04ad43ed7d12d79d866607fb8e0389263b8 (diff) |
Work around non-regular last comic pages
-rwxr-xr-x | bin/comirror | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/comirror b/bin/comirror index 9068636..6604657 100755 --- a/bin/comirror +++ b/bin/comirror @@ -6,7 +6,7 @@ use 5.010; use WWW::Mechanize; my $mech = WWW::Mechanize->new( - stack_depth => 0, + stack_depth => 2, ); my $uri = shift || read_file('last_uri'); @@ -78,6 +78,11 @@ sub read_file { } sub save_lasturi { + + # Some webcomics have a non-regular page for the last (as in, latest) + # image. Work around this. + $mech->back(); + open(my $fh, '>', 'last_uri') or die("Cannot open last_uri: $!\n"); print {$fh} $mech->uri->as_string; close($fh) or die("Cannot close last_uri: $!\n"); |