#!/bin/tcsh -f #(ie run the tshell on this but don't read the .cshrc or .tcshrc) set ver = "version = 1.09 of yvph 2011 Sep 04" # 2011 Sep 04, 1.09: update documentation # 2010 Apr 30, 1.08: fix quotes in help documentation # 2009 Dec 23, 1.07: report problems from yvp # 2009 Oct 01, 1.06: automatic link following # 2009 Apr 29, 1.05: yvph output is only to be html! # 2009 Apr 25, 1.04: debug statements, rename output yvph not ayvp # 2009 Apr 24, 1.03: grep the url without the openURL call # 2009 Apr 23, 1.02: grep the url # 2007 Nov 01, 1.01: modify ayvp to produce pure html # 2007 Sep 1, 1.00: origin if ($#argv < 1) then echo '
' echo "$ver" echo echo 'usage: yvph [year] [volume] [page] > my.html' echo 'usage: yvph [volume] [page] > my.html' echo 'usage: yvph [year] [volume] [page] [another key] > my.html' echo 'Find article with given year/volume/page in PubMed-to create an html file' echo "by using yvp." echo "If yvp doesn't automatically point your browser at the page," echo "point your browser to the file and click the link given." echo "You might not need to click to get to the pubmed page." echo echo "Example:" echo " yvph 1986 188 415 > my.html" echo echo "Documentation:" echo "http://www.ccrnp.ncifcrf.gov/~toms/yvp.html" echo echo "Technical note:" echo "The output of yvph is always to be pure html." echo echo "Dr. Thomas D. Schneider" echo "National Institutes of Health" echo "schneidt@mail.nih.gov" echo "toms@alum.mit.edu (permanent)" echo "http://alum.mit.edu/www/toms (permanent)" echo '' exit endif #******************************************************************************* # temporary files # output of yvp in tmp1: set tmp1 = /tmp/`whoami`-1.yvph # html file being created: set tmp2 = /tmp/`whoami`-2-`tomdate '-'`.yvph #******************************************************************************* # create $tmp1 if ($#argv == 2) then yvp $1 $2 > $tmp1 endif if ($#argv == 3) then yvp $1 $2 $3 > $tmp1 endif if ($#argv == 4) then yvp $1 $2 $3 $4 > $tmp1 endif #******************************************************************************* # determine url from $tmp1 #echo --- # set url = "`tail -1 $tmp1`" set url = "`grep http $tmp1|grep -v openURL`" # echo "$url" #echo --- if ("$url" == '') then echo -n "" > $tmp2 echo '' >> $tmp2 echo '
' >> $tmp2 echo "url is empty!" >> $tmp2 cat $tmp1 >> $tmp2 echo '' >> $tmp2 echo '' >> $tmp2 cat $tmp2 exit endif #******************************************************************************* # make header of $tmp2 echo -n "" > $tmp2 echo '' >> $tmp2 echo '> $tmp2 echo '">' >> $tmp2 echo "$ver" >> $tmp2 echo '
' >> $tmp2 # make listing of $tmp2 if ($#argv == 2) then echo "year: $1" >> $tmp2 echo "volume: $2" >> $tmp2 endif if ($#argv == 3) then echo "year: $1" >> $tmp2 echo "volume: $2" >> $tmp2 echo "page: $3" >> $tmp2 endif if ($#argv == 4) then echo "year: $1" >> $tmp2 echo "volume: $2" >> $tmp2 echo "page: $3" >> $tmp2 echo "key: $4" >> $tmp2 endif echo '' >> $tmp2 echo '> $tmp2 #echo hi there echo ">$url" >> $tmp2 echo '' >> $tmp2 #echo --- end of yvph #echo --- $tmp2 cat $tmp2 #*******************************************************************************