diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2010-05-22 14:06:45 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2010-05-22 14:06:45 +0200 |
commit | 55e0299bfa44af9c9fc045daa23d8923182aef9c (patch) | |
tree | 459d870232cd1901eea5c2b3cad7060a3397a990 | |
parent | 66a4b66fc473191ddb38b446ca8b422a57b48f49 (diff) |
comirror-setup: Detect next-link, just in case
-rwxr-xr-x | bin/comirror-setup | 10 |
1 files changed, 9 insertions, 1 deletions
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"; |