Monday, June 06, 2005

Travelling with light luggage

Unfortunately, my laptop' hard drive doesn't have enough room to contain all of hep-th, so I need to make a selection when travelling.

To this end, I wrote a little perl script that takes a Spires querry on the command line and then downloads all pdf's that come up for this querry (actually the first page of the web results) to the current directory. To use it, chmod a+x getspires, move it to some directory in your path and the for example
getspires a witten

to get Ed's latest or
getspires FIND C QJMAA,54,281

for a bibliography on generalized geometry.

Enjoy!

2 comments:

Anonymous said...

perl -MLWP::Simple -e '$"="+";$q=get("http://www.slac.stanford.edu/spires/find/hep/www?rawcmd=@ARGV");$q=~s^\Qarxiv.org/pdf/\E([0-9a-z/-]+)^$p=get"http://de.arxiv.org/pdf/$1";$n=$1;$n=~y#/#%#;open X,">$n.pdf";print X $p^ieg' find au helling

Robert said...

Ok, ok, but if you want to make this golf first make sure the code actually works and reloads if it gets the "Come back in 10 seconds, we have to reTeX the paper" answer. That's what I had LWP:UserAgent in mind for (checking ContentType for pdf vs text/html) however, runnig file on the output seemed simpler.