R/url_to_json.R

Defines functions url_to_json

# Read URL into a JSON format
url_to_json <- function(url) url |>
  throttle() |>
  utils::URLencode() |>
  readLines(warn = FALSE) |>
  RJSONIO::fromJSON() |>
  tryCatch(error = function(e) {
    warning(e)
    return(list())
  })
ivan-rivera/RedditExtractoR documentation built on Sept. 9, 2023, 11:31 a.m.