The New York Times web site provides a rich set of APIs, as described here: http://developer.nytimes.com/docs You’ll need to start by signing up for an API key. Your task is to choose one of the New York Times APIs, construct an interface in R to read in the JSON data, and transform it to an R dataframe.
New York times API can be registered to at http://developer.nytimes.com/signup
# Load the libraries
library("httr")
library("rjson")
library("DT")api.key <- "0bed27e078464cd595721a8cd5243dd5"
url <- "http://api.nytimes.com/svc/topstories/v1/home.json?api-key="
result <- GET(paste(url, api.key, sep=""))url.content <- content(result)## No encoding supplied: defaulting to UTF-8.
content.list <- fromJSON(url.content)
content.df <- as.data.frame(do.call(rbind, content.list$results))
colnames(content.df)## [1] "section" "subsection" "title"
## [4] "abstract" "url" "byline"
## [7] "item_type" "updated_date" "created_date"
## [10] "published_date" "material_type_facet" "kicker"
## [13] "des_facet" "org_facet" "per_facet"
## [16] "geo_facet" "multimedia"
datatable(content.df)