Created
January 17, 2014 00:56
-
-
Save tpoisot/8466530 to your computer and use it in GitHub Desktop.
I've invented a way NOT to get a citation from a DOI using the crossref API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python2 | |
import requests as re | |
doi = "10.1002/ece3.508" | |
base = "http://dx.doi.org/" | |
url = base + doi | |
#headers = {'Accept': 'text/bibliography', 'style': 'ecology-letters'} | |
ref = re.get(url) | |
print ref.text |
This works for me
import requests as re
doi = "10.1371/journal.pone.0083953"
base = "http://dx.doi.org/"
url = base + doi
headers = {"Accept": "text/bibliography; style=mla; locale=fr-FR"}
ref = re.get(url, headers=headers)
print ref.text
Nifong, James C. et al. « Animal-Borne Imaging Reveals Novel Insights into the Foraging Behaviors and Diel Activity of a Large-Bodied Apex Predator, the American Alligator (Alligator mississippiensis) ». éd par. Christopher D. Marshall. PLoS ONE 9.1 (2014): e83953.
Or json return with:
headers = {"Accept": "application/citeproc+json"}
{"volume":"3","issue":"4","DOI":"10.1002/ece3.508","URL":"http://dx.doi.org/10.1002/ece3.508","title":"High-Throughput Sequencing: A Roadmap Toward Community Ecology","container-title":"Ecology and Evolution","publisher":"Wiley Blackwell (John Wiley & Sons)","issued":{"date-parts":[[2013,4,11]]},"author":[{"family":"Poisot","given":"Timothée"},{"family":"Péquin","given":"Bérangère"},{"family":"Gravel","given":"Dominique"}],"editor":[],"page":"1125-1139","type":"article-journal"}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Weird, worked for a different DOI using accept header