Learn R Programming

tm.plugin.webmining (version 0.9)

NYTimesSource: Get feed data from NYTimes Article Search (http://developer.nytimes.com/docs/read/article_search_api).

Description

Excerpt from the website: "With the NYTimes Article Search API, you can search New York Times articles from 1981 to today, retrieving headlines, abstracts, lead paragraphs, links to associated multimedia and other article metadata. Along with standard keyword searching, the API also offers faceted searching. The available facets include Times-specific fields such as sections, taxonomic classifiers and controlled vocabulary terms (names of people, organizations and geographic locations)." Feed retrieval is limited to 100 items.

Usage

NYTimesSource(query, n = 100, count = 10, appid,
    params = list(format = "json", query = query, offset = seq(0, n - count, by = count), `api-key` = appid),
    ...)

Arguments

query
character specifying query to be used to search NYTimes articles
n
number of results defaults to 100
count
number of results per page, defaults to 10
appid
Developer App id to be used, obtained from http://developer.nytimes.com/
params
additional query parameters, specified as list, see http://developer.nytimes.com/docs/read/article_search_api
...
additional parameters to WebSource

See Also

WebSource, readNYTimes

Examples

Run this code
#nytimes_appid needs to be specified
corpus <- Corpus(NYTimesSource("Microsoft", appid = nytimes_appid))

Run the code above in your browser using DataLab