knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
R wrapper to the newsriver.io, an API to obtain news articles.
# install.packages("remotes") remotes::install_github("news-r/newsriver")
First, create an account to obtain an API key. Then either specify the aforementioned key using newsriver_key
or specify it as environment variable (likely in your .Renviron
) as NEWSRIVER_API_KEY
.
library(newsriver) newsriver_key("xXxxX")
library(newsriver) news <- nr_search('language:en AND text("Trump")') news[[1]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.