Created
November 23, 2010 22:39
-
-
Save astrofrog/712676 to your computer and use it in GitHub Desktop.
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
| from mendeley_client import MendeleyClient | |
| mendeley = MendeleyClient(..., ...) # Fill out API keys here | |
| try: | |
| mendeley.load_keys() | |
| except IOError: | |
| mendeley.get_required_keys() | |
| mendeley.save_keys() | |
| response = mendeley.library() | |
| pages = response['items_per_page'] | |
| dois = {} | |
| for page in range(pages): | |
| print "Page %i..." % page | |
| response = mendeley.library(page=page) | |
| for document_id in response['document_ids']: | |
| print "Document %s..." % document_id | |
| document = mendeley.document_details(document_id) | |
| if type(document['identifiers']) is dict \ | |
| and 'doi' in document['identifiers']: | |
| dois[document_id] = document['identifiers'] | |
| else: | |
| dois[document_id] = None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment