]> git.donarmstrong.com Git - bin.git/blobdiff - get_pdf
update get_pdf to deal with the fact that links2 doesn't like leading http:// of...
[bin.git] / get_pdf
diff --git a/get_pdf b/get_pdf
index e5624546d22e39a67e1581fd621d6b10899e59fd..4a3f76b753c1c65fb04abcd389f65ed93820d7e1 100755 (executable)
--- a/get_pdf
+++ b/get_pdf
@@ -153,7 +153,8 @@ if ($options{pmid}) {
        if ($@) {
            print STDERR "$@\n" if $DEBUG;
            system('links2',
-                  exists $options{http_proxy}?('-http-proxy',$options{http_proxy}):(),
+                   # links2 doesn't like the leading http:// of proxies for some reason
+                  exists $options{http_proxy}?('-http-proxy',(map {s{http://}{}; $_} $options{http_proxy})):(),
                   $url
                  ) == 0 or next;
            rename('temp.pdf',"${pmid}.pdf") if -e 'temp.pdf';