get_headlines: Get headlines A helper function to get just the headlines of...

View source: R/get_headlines.R

get_headlinesR Documentation

Get headlines A helper function to get just the headlines of the feed

Description

Get headlines A helper function to get just the headlines of the feed

Usage

get_headlines(
  website = "ycombinator.com",
  topic = NULL,
  rss_table = package_rss
)

Arguments

website

a url of a new source in the format "news.ycombinator.com"

topic

the topic of the feed, by default it is NULL which means it will fetch the "main" feed. topics are 'tech', 'news', 'business', 'science', 'finance', 'food', 'politics', 'economics', 'travel', 'entertainment', 'music', 'sport', 'world', but not all site have all topics. use describe_url("website") to check for available feeds.

rss_table

a dataframe with urls and rss feeds in case you need to construct your own out of websites not in the included database. Be sure to have the same format as the included data. See package_rss for details.

Value

a tibble containing the headlines contained in the feed

Examples

## Not run: 
Sys.sleep(3) # adding a small time delay to avoid
# simultaneous posts to the API
get_headlines(website = "ycombinator.com", rss_table = package_rss)

## End(Not run)

discindo/newscatcheR documentation built on Sept. 28, 2023, 6:38 p.m.