From 44459767caf31fee8f92bff6f606e9bc403d50d6 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 20 May 2010 22:19:17 +0200 Subject: Work around non-regular last comic pages --- bin/comirror | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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"); -- cgit v1.2.3