R/authenticate_v2_x.R

Defines functions authenticate_v2_x

Documented in authenticate_v2_x

#' Authenticate against the MySportsFeeds API (v2.x)
#'
#' Sets the authentication credentials in R environment variables
#'
#' @param apikey.  Your MySportsFeeds API Key
#' @examples
#' \dontrun{
#' authenticate_v2_x("<your-api-key>")}
#' @export
#' authenticate_v2_x

authenticate_v2_x <- function(apikey){
    if(!is.null(apikey)){
        .MySportsFeedsEnv$data$apikey <- apikey
        .MySportsFeedsEnv$data$password <- 'MYSPORTSFEEDS'
    }
    else{
        warning("You must supply a valid API Key to access the MySportsFeeds API (v2.x).")
    }
}
MySportsFeeds/mysportsfeeds-r documentation built on March 10, 2021, 6:20 p.m.