Skip to content

Instantly share code, notes, and snippets.

@sunhwan
Forked from achabotl/doi2bib
Created June 24, 2016 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunhwan/9ddd165e6850f4c4c06611cfeffc3809 to your computer and use it in GitHub Desktop.
Save sunhwan/9ddd165e6850f4c4c06611cfeffc3809 to your computer and use it in GitHub Desktop.
doi2bib
#!/bin/sh
if [[ "${1}" == "http"* ]] ; then
doi="${1}"
else
doi="http://dx.doi.org/${1}"
fi
# Stopped working around 2015-10-04.
# curl -sLH "Accept: text/bibliography; style=bibtex" "${doi}" | sed 's/^ *//'
# This still works and seems to be the recommended approach: http://www.crosscite.org/cn/
curl -LH "Accept: application/x-bibtex" "${doi}" | sed 's/^ *//'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment