#! /bin/sh - ### ==================================================================== ### Given one or more DOIs on the command line (with or without the ### "http://dx.doi.org/" prefix), generate rough BibTeX entries by ### online database lookup. ### ### This tool can be useful for recovering additional data, such as ### missing number and month values, for existing BibTeX entries. ### ### Usage: ### doi-to-bibtex.sh doi-1 doi-2 ... > foo.bib ### doi-to-bibtex.sh doi-1 doi-2 ... | bibclean > foo.bib ### doi-to-bibtex.sh doi-1 doi-2 ... | fix-order.sh > foo.bib ### doi-to-bibtex.sh doi-1 doi-2 ... | fix-order.sh | journal.sh > foo.bib ### ### [25-Nov-2015] ### ==================================================================== IFS=' ' PATH=/bin:/usr/bin export PATH for f in "$@" do printf "\n%%%% DOI: %s\n\n" "$f" g=`echo $f | sed -e s@https*://dx.doi.org/@@ -e 's@https*://doi.org/@@'` curl -LH "Accept: application/x-bibtex" http://dx.doi.org/"$g" printf "\n\n" done