Skip to content

Instantly share code, notes, and snippets.

@shawngraham
Created January 25, 2015 23:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shawngraham/0907ab2c2185cfe9f91b to your computer and use it in GitHub Desktop.
Save shawngraham/0907ab2c2185cfe9f91b to your computer and use it in GitHub Desktop.
install.packages("devtools")
devtools::install_github("ropensci/rdpla")
library('rdpla')
mykey = "PUT YOUR KEY FROM DP.LA HERE"
# do a query; here we want ids which we can feed to wget
itemlist = items(key=mykey, q="science", date_before=1900, page_size=100, fields=c("id"))
# this will write the ids to a list; you'll need to open it in a spreadsheet, remove the first row if it's not an id
write.csv(itemlist $data, "itemlist.csv", row.names=FALSE)
# save the csv to txt (utf 8), then you can pass to wget as in Exercise 4 at
# https://github.com/hist3907b-winter2015/module2-findingdata/blob/master/m2-exercises.md
# knowing the dp.la URL structure - right?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment