]> git.donarmstrong.com Git - bin.git/commitdiff
update get_pdf to deal with the fact that links2 doesn't like leading http:// of...
authorDon Armstrong <don@donarmstrong.com>
Mon, 21 Jan 2013 19:52:37 +0000 (11:52 -0800)
committerDon Armstrong <don@donarmstrong.com>
Mon, 21 Jan 2013 19:52:37 +0000 (11:52 -0800)
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';