CrossRef/pdfextract — pull request #11 by jdherman (2014-07-16 18:17:36+00:00)
Title: Fix reference resolver, and add option to output BibTeX with the CrossRef API

Thanks for making this library! It's a great idea.

Two suggestions in this pull request:
1. The resolver for the `--resolved-references` option was broken. I switched it to the updated `http://search.labs.crossref.org/dois?q=#{...}`. If found, it sticks the DOI and score into the XML output.

2. Add a new `extract-bib` command, which first finds the resolved reference DOIs, and then uses the REST API to fetch the bibtex citation at `http://api.crossref.org/works/#{doi}/transform/application/x-bibtex`. This does not affect the existing XML output with the `extract` command. It outputs the bibtex citations to `{file_base}.bib`. It's a little slow with all the fetching, so I added verbose output to make sure everything's working ok. Only the refs with `score > 1` are printed to the bibtex file.

I'd love to see both of these in the gem someday. I think (2) especially could be extended to any format supported by the new CrossRef API.