R wrapper to the webhose.io API.

Install

devtools::install_github("JohnCoene/webhoser")

Examples

token <- <- wh_token("xXX-x0X0xX0X-00X") # setup token

# webhoser object
token %>% 
  wh_news(q = '"World Economic Forum" is_first:true language:english site_type:news') -> news

# basic
# collect results
token %>% 
  wh_news(q = '"World Economic Forum"') %>% # get news
  wh_collect -> basic
  
# flatten results
token %>% 
  wh_news(q = '"World Economic Forum" OR WEF') %>% # get news
  wh_collect(TRUE) -> flat  # flatten results
  
# broadcasts
token %>% 
  wh_broadcasts('Davos AND WEF OR "World Economic Forum"') %>% 
  wh_paginate(p = 1) %>% 
  wh_collect() -> davos_broadcasts

# get three pages on the WEF.
# format dates
token %>%  
  wh_news(q = '"World Economic Forum" OR WEF') %>% 
  wh_paginate(3) %>% 
  wh_collect() %>% 
  dplyr::mutate(published = wh_date(published)) -> wef