Skip to content

Instantly share code, notes, and snippets.

@achabotl
Last active June 24, 2016 15:30
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save achabotl/2a21182b1817b8308c08 to your computer and use it in GitHub Desktop.
Save achabotl/2a21182b1817b8308c08 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/^ *//'
@achabotl
Copy link
Author

achabotl commented Oct 4, 2015

Updated because the text/bibligraphy header stopped working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment