#' @title Major Company Developments
#' @description Get company developments
#'
#' @param symbol Ticker symbol
#' @param from Begin date
#' @param to End date
#'
#' @importFrom purrr set_names
#' @importFrom lubridate today as_datetime
#' @importFrom dplyr mutate
#'
#' @return
#' @export
#'
#' @examples
#' major_developments('NVDA', from = '2020-05-01', to = lubridate::today())
major_developments <- function(symbol,
from = lubridate::today(tz = finnhub_timezone) - 365,
to = lubridate::today(tz = finnhub_timezone),
...){
url <- finnhub_endpoint('major_developments')
retry_get(url,
query = list(token = finnhub_key(),
symbol = symbol,
from = from,
to = to)) %>%
.[['majorDevelopment']] %>%
purrr::set_names(c('symbol', 'date', 'headline', 'summary')) %>%
dplyr::mutate(date = lubridate::ymd_hms(date, tz = finnhub_timezone))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.