Skip to content

Instantly share code, notes, and snippets.

@noamross
Created June 12, 2014 11:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noamross/5e1e27af5808d8936286 to your computer and use it in GitHub Desktop.
Save noamross/5e1e27af5808d8936286 to your computer and use it in GitHub Desktop.
Grab DOIs of all PeerJ articles from a subject area
#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