#' Call the speedrun.com API
#'
#' @param path API path.
#' @param ... Optional parameters
#'
#' @return The [httr::content] of the API response.
#' @export
#'
#' @examples
#' \dontrun{
#' # Get all users
#' sr_get(path = "users")
#' }
sr_get <- function(path = "", ...) {
if (grepl(getOption("speedruncom_base"), path)) {
url <- path
} else {
url <- paste0(getOption("speedruncom_base"), path)
}
url <- httr::modify_url(
url = url,
query = list(...)
)
res <- httr::GET(url)
httr::warn_for_status(res)
res <- httr::content(res)
res
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.