This file contains 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
"""get_works.py: Fetch all the works from CrossRef API by DOI prefix.""" | |
__author__ = "Juan Pablo Alperin (@juancommander)" | |
import re | |
import urllib, urllib2 | |
import simplejson as json | |
from time import sleep | |
import datetime |
This file contains 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
# -*- coding: utf-8 -*- | |
#!/usr/bin/env python | |
### Example code to access the Mendeley OAuth2 API | |
### Author: Juan Pablo Alperin | |
import requests | |
import requests.auth | |
import urllib | |
CLIENT_ID = '' | |
CLIENT_SECRET = '' |
This file contains 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
import re | |
import fileinput | |
def change_references(s): | |
# inline citations are always single author, take them out of [] | |
s = re.sub(r'\[#([^\]]+);\]', '@\\1', s) | |
n = 1 | |
# replace all the "," in [#xxx,xxx,xxx,xxx] with ,@ | |
while ( n > 0 ): |
This file contains 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
import json | |
import urllib, urllib2 | |
import urlparse | |
from unidecode import unidecode | |
CROSSREF_API_DOI = 'http://search.crossref.org/dois?' | |
def verify_doi(doi,article): | |
doi_query_url = 'http://search.crossref.org/dois?' + urllib.urlencode({'q': doi}) | |
response = json.loads(urllib2.urlopen(doi_query_url).read()) |
This file contains 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
{ | |
"metadata": { | |
"name": "Final Assignment" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.