Created
June 12, 2014 11:54
-
-
Save noamross/5e1e27af5808d8936286 to your computer and use it in GitHub Desktop.
Grab DOIs of all PeerJ articles from a subject area
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 DOIs for subject area from PeerJ | |
library(httr) | |
library(plyr) | |
#JSON for Ecology articles (paginated): | |
ecol_url = "https://peerj.com/articles/index.json?subject=1100" | |
dois = list() | |
repeat { | |
ecol_json = content(GET(ecol_url)) | |
dois = c(dois, (laply(ecol_json$`_items`, function(x) x$doi))) | |
if(is.null(ecol_json$`_links`$`next`$href)) break | |
ecol_url = ecol_json$`_links`$`next`$href | |
} | |
dois = unlist(dois) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment