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())
  })

Try the RedditExtractoR package in your browser

Any scripts or data that you put into this service are public.

RedditExtractoR documentation built on March 31, 2023, 5:18 p.m.