]> git.donarmstrong.com Git - bin.git/commitdiff
* fix wrong article being pulled from sd article
authorDon Armstrong <don@donarmstrong.com>
Tue, 24 Aug 2010 03:08:33 +0000 (03:08 +0000)
committerDon Armstrong <don@donarmstrong.com>
Tue, 24 Aug 2010 03:08:33 +0000 (03:08 +0000)
get_pdf

diff --git a/get_pdf b/get_pdf
index 3768e5217970af5e4410e527b23b21c9763b0e01..8187738bb1bd80fec8f07068892e5ee18501bf82 100755 (executable)
--- a/get_pdf
+++ b/get_pdf
@@ -178,6 +178,8 @@ sub find_pdf_link {
        print STDERR $m->content() if $DEBUG;
     }
     my @possible_links;
+    # this is to prioritize the real link at science direct
+    push @possible_links, grep { $_->url_abs() !~ /_orig=article/} $m->find_all_links(text_regex => qr/PDF/i);
     push @possible_links, $m->find_all_links(tag_regex => qr/meta/,
                                             url_regex  => qr/(reprint|\.pdf)/i,
                                            );