This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getOptions(token=false){const options={headers:{accept:"application/json, text/plain, */*","accept-language":"en-US,en;q=0.6","content-type":"application/json"},referrer:"https://racenet.com/",referrerPolicy:"strict-origin-when-cross-origin",method:"GET",credentials:"include"};if(token!==false){options.headers.authorization=`Bearer ${token}`}return options}function strings(name){switch(name){case"STAGE_INFO_SHOW":return"Show Stages";case"STAGE_INFO_HIDE":return"Hide Stages";default:return"Unhandled"}}function consts(name){switch(name){case"SECONDS_IN_DAY":return 86400;case"SECONDS_IN_HOUR":return 3600;case"SECONDS_IN_MINUTE":return 60}}async function getBearer(){const url="https://web-api.racenet.com/api/identity/refresh-auth";const options=getOptions();options.method="POST";options.body='{"clientId":"RACENET_1_JS_WEB_APP","grantType":"refresh_token","refreshToken":"","redirectUri":"https://racenet.com/oauthCallback","authCode":"","codeVerifier":""}';const response=await fetch(url,options);const data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getOptions(token = false) { | |
const options = { | |
headers: { | |
accept: "application/json, text/plain, */*", | |
"accept-language": "en-US,en;q=0.6", | |
"content-type": "application/json", | |
}, | |
referrer: "https://racenet.com/", | |
referrerPolicy: "strict-origin-when-cross-origin", | |
method: "GET", |