Skip to content

Instantly share code, notes, and snippets.

@antagomir
Forked from konrad/doi2bibtex.sh
Created August 22, 2017 10:41
Show Gist options
  • Save antagomir/165c841a8b59f2d94677468b0b3f5f40 to your computer and use it in GitHub Desktop.
Save antagomir/165c841a8b59f2d94677468b0b3f5f40 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 -H "Accept: application/x-bibtex" https://data.crossref.org/${DOI}
echo ""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment