65 points · by michaelq · 12y ago · 73 comments
curl -LH "Accept: text/bibliography" "http://dx.doi.org/10.1017/S0022112061000019"
curl -LH "Accept: text/bibliography; style=bibtex" "http://dx.doi.org/10.1017/S0022112061000019"
curl -LH "Accept: text/bibliography; style=apa" "http://dx.doi.org/10.1017/S0022112061000019"
My academic life became a lot simpler when I learnt this - now I only need to maintain a database of {cite key: DOI} pairs, rather than a bibtex monster. Yes, I have tried Mendeley et al. and yes, I do prefer scripts that do what I tell them to.Any questions email, us at labs@crossref.org
*which are the kinds of DOI you're likely to be citing, but other Registration Agencies and types of DOIs exist
import requests
import json
url = 'http://data.crossref.org/10.1017/S0022112061000019'
headers = {'Accept': 'application/citeproc+json'}
r = requests.get(url, headers=headers)
meta = json.loads(r.content)
# meta is a dictionary of metadata, e.g. meta['DOI']One minor usability issue, clicking the different style after generating the citation doesn't have any result until you generate a new citation. That is a little unintuitive. I would either switch to the different style immediately or put some separation in the UI between the returned citation and the components that are used to generate a new citation.
Also, "http://google.com" complains about robots.txt, but "http://google.com/" (trailing slash) does not.
The MLA format cite comes out as:
"Show HN: One." Ycombinator.com. N.p. Web. 30 Apr. 2014. <https://news.ycombinator.com/>
The APA format cite comes out as:
Show HN: One. Ycombinator.com. Retrieved Apr 30, 2014, from https://news.ycombinator.com.
The Chicago formate cite comes out as:
"Show HN: One." Ycombinator.com. https://news.ycombinator.com/.
Show HN: One-click citations for your essays (speedcite.com)
The Fault in Our Stars Paperback by John Green: http://www.amazon.com/The-Fault-Stars-John-Green/dp/01424241...
Feature suggestions: would be nice if it accepted PubMed ids, and supported other popular citation styles like Hardvard and Vancouver (or alternatively, permitted some customisation of the citation format).
You can check the Registration Agency with CrossRef to see who's responsible for it:
http://doi.crossref.org/ra/10.1073/pnas.1324197111
In this case, it is CrossRef. So this should work: http://api.crossref.org/works/10.1073/pnas.1324197111
It doesn't. I'll see if I can find out what's wrong.
If you have any questions you can email labs@crossref.org
EDIT: Looking at the Guest Query, http://www.crossref.org/guestquery/ it looks like this was deposited recently. There may be a delay in propagation through our systems.
The only two services I've found that accept it are http://hdl.handle.net/ and http://dx.doi.org/, and I think they're querying the same database.
That DOI is newly deposited, as I said in other comments, it may take a while to propagate.
EDIT: aha, you have to remove dashes for it to work. It should probably do this automatically.
The subject line gets cut much too short, and the URL gets trimmed to the root level of the domain.
I don't think the ISBN lookup works correctly. Typing in 9781405347587 or 978-1405347587 returns a book with ISBN 0-9690745-2-2
I'd be looking forward to upgraded version with IEEE but I just graduated, ha!
Amazon has the ISBN 9781405347587. The only other google result for this is your comment, which Google seems to have already indexed :)
Since Google Books doesn't have that ISBN, I would need 1) fail gracefully instead of giving a citation for the wrong book and 2) have a fallback API. I'm working on both of these. Thanks!