Skip to content

Instantly share code, notes, and snippets.

@konrad
Last active August 23, 2017 08:52
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save konrad/3af99113f148d6815636decd92b3a47b to your computer and use it in GitHub Desktop.
Save konrad/3af99113f148d6815636decd92b3a47b to your computer and use it in GitHub Desktop.
Returns a BibTeX entry for one or more given DOIs.
#!/usr/bin/env bash
# Returns a BibTeX (www.bibtex.org) entry for one or more given DOIs
# (https://www.doi.org/).
#
# Call it like this:
#
# $ doi2bibtex.sh 10.1093/bioinformatics/btu533
#
# Can also be used for several DOIs at once:
#
# $ doi2bibtex.sh 10.1093/bioinformatics/btu533 10.1038/sj.embor.7400538
for DOI in "$@"
do
curl -L -H "Accept: application/x-bibtex" https://doi.org/${DOI}
echo ""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment