From 55e0299bfa44af9c9fc045daa23d8923182aef9c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 22 May 2010 14:06:45 +0200 Subject: comirror-setup: Detect next-link, just in case --- bin/comirror-setup | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/comirror-setup b/bin/comirror-setup index 7f72820..b38cfe4 100755 --- a/bin/comirror-setup +++ b/bin/comirror-setup @@ -18,6 +18,7 @@ my @images; my @unique_images; my ($image_re, $cache) = (q{}) x 2; my $length; +my $next_link; local $| = 1; @@ -44,6 +45,12 @@ for my $i ( 0 .. $#mechs ) { print "\n"; +for my $link ($mechs[0]->find_all_links()) { + if ($link->url_abs eq $ARGV[1]) { + $next_link = $link->text; + } +} + # A bit fragile so far. We assume that every site is exactly the same, except # for the actual comic image. For this to work, we need to be sure that we are # not comparing with a first or last site, because those may be missing a @@ -89,4 +96,5 @@ line_to_file($ARGV[0], 'last_uri'); line_to_file($image_re, 'image_re'); print "\nimage_re: ${image_re}\n\n"; -print "If this is correct, type 'comirror' to start mirroring\n"; +say "\"next\" link text: ${next_link}"; +say "If this is correct, type 'comirror' to start mirroring"; -- cgit v1.2.3