NYTimesSource: Get feed data from NYTimes Article Search (<URL:...

Description Usage Arguments Author(s) See Also Examples

View source: R/source.R

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 1000 items (or 100 pages).

Usage

1
2
3
4
NYTimesSource(query, n = 100, appid, count = 10, sleep = 1,
  params = list(format = "json", q = query, page = 1:ceiling(n/count),
  `api-key` = appid), curlOpts = curlOptions(followlocation = TRUE,
  maxconnects = 10, maxredirs = 10, timeout = 30, connecttimeout = 30), ...)

Arguments

query

character specifying query to be used to search NYTimes articles

n

number of items, defaults to 100

appid

Developer App id to be used, obtained from http://developer.nytimes.com/

count

number of results per page, defaults to 10

sleep

integer; Seconds to sleep between feed retrieval.

params

additional query parameters, specified as list, see http://developer.nytimes.com/docs/read/article_search_api

curlOpts

CURLOptions; RCurl options used for feed retrieval.

...

additional parameters to WebSource

Author(s)

Mario Annau

See Also

WebSource, readNYTimes

Examples

1
2
3
4
5
## Not run: 
#nytimes_appid needs to be specified
corpus <- WebCorpus(NYTimesSource("Microsoft", appid = nytimes_appid))

## End(Not run)

tm.plugin.webmining documentation built on May 2, 2019, 1:10 p.m.