#' Get list of calendars from google.
#'
#'
#' @param token token obtained from [calendar_token()]
#'
#' @return Tibble with columns for `id`, `summary` and `description`.
#' @family calendar functions
#'
#' @export
calendar_list <- function(token = calendar_token()){
req <- request_generate("calendar.calendarList.list", token = token)
r <- request_make(req)
httr::stop_for_status(r)
r <- content(r)
if (length(r[["items"]]) == 0) {
tibble(
id = character(),
summary = character(),
description = character()
)
} else {
r[["items"]] %>%
map_dfr(
~tibble(
id = .[["id"]] %||% NA,
summary = .[["summary"]] %||% NA,
description = .[["description"]] %||% NA
)
)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.