Skip to content

Fix reference resolver, and add option to output BibTeX with the CrossRef API

Joe Wass requested to merge github/fork/jdherman/feature/bibtex-resolve into master

Created by: jdherman

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. Thanks again!

Merge request reports