]> git.donarmstrong.com Git - bin.git/commitdiff
follow pmc links in addition to full text links
authorDon Armstrong <don@donarmstrong.com>
Tue, 25 Jun 2013 03:16:26 +0000 (20:16 -0700)
committerDon Armstrong <don@donarmstrong.com>
Tue, 25 Jun 2013 03:16:26 +0000 (20:16 -0700)
get_pdf

diff --git a/get_pdf b/get_pdf
index 2aa84169aaa0afe672fd28b00ea69a6fae6597f3..2184c1c80a2314a8e480f5100f1b6974c9739e53 100755 (executable)
--- a/get_pdf
+++ b/get_pdf
@@ -126,7 +126,7 @@ if ($options{pmid}) {
            my @possible_links = $m->find_all_links(text_regex => qr/to\s*read/i);
            # try to find the other links
            push @possible_links,
-               grep {my $attr = $_->attrs(); exists $attr->{title} and $attr->{title} =~ qr/Full\s*Text/i}
+               grep {my $attr = $_->attrs(); exists $attr->{title} and $attr->{title} =~ qr/(?:Full\s*Text|PMC)/i}
                    $m->links();
            print STDERR map {"article link: ".$_->url_abs()."\n"} @possible_links if $DEBUG;
            die "No links" unless @possible_links;