Skip to content

Instantly share code, notes, and snippets.

@jbernhard
Last active August 29, 2015 14:10
Show Gist options
  • Save jbernhard/5392f7796cdf424ede74 to your computer and use it in GitHub Desktop.
Save jbernhard/5392f7796cdf424ede74 to your computer and use it in GitHub Desktop.
#!/usr/bin/bash
# Provides a command-line interface to generate a bibtex file using Inpire's web tool
# https://inspirehep.net/submit?doctype=bibtex&act=SBI
# Usage: ./generate-bibtex.sh file.tex
curl --silent \
--form "step=1" \
--form "access=`date +%s_%N`" \
--form "act=SBI" \
--form "doctype=bibtex" \
--form "BibTex_input=@$1" \
--form "OUT_FORMAT=hx" \
'https://inspirehep.net/submit' | \
sed -n '/^@article{/,/^}$/p'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment