R/utils-zzzz.R

Defines functions jpage_func veb

## Base URL for API calls
url_util <- "https://lda.data.parliament.uk/"

veb <- function(verbose) {
  if (verbose) {
    message("Connecting to API")
  }
}

jpage_func <- function(query) {
  x <- jsonlite::fromJSON(paste0(query, "&_pageSize=1"), flatten = TRUE)

  floor(x$result$totalResults / 100)
}
evanodell/hansard documentation built on Oct. 10, 2021, 9:52 a.m.