Skip to content
View zendulu's full-sized avatar

Block or report zendulu

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 250 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Pinned Loading

  1. zendrive zendrive Public

    Custom pacenote and co-driver plugin for EA Sports WRC

    Python 2

  2. EA Sports WRC Club script. You can u... EA Sports WRC Club script. You can use this script to help navigate EA Sports WRC Racenet clubs. Join Barrel rollers discord: https://discord.gg/barrelrollers and See: https://discord.com/channels/612903610061422592/1153198692401164349/1339769793481408592 for instructions on how to use. minified version of https://gist.github.com/zendulu/568d342c1d7d398e7e52d72ae70b5860
    1
    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=await response.json();return data.access_token}async function getClubInfo(token,club){const options=getOptions(token);const url=`https://web-api.racenet.com/api/wrc2023clubs/${club.clubID}?includeChampionship=true`;const response=await fetch(url,options);const data=await response.json();return data}function isEventOpen(event){const now=new Date;if(typeof event.absoluteOpenDate!=="undefined"&&typeof event.absoluteCloseDate!=="undefined"){const open=new Date(event.absoluteOpenDate);const close=new Date(event.absoluteCloseDate);return open<now&&now<close}return false}function leaderBoardStatus(event){if(event.leaderboard===undefined){return"NA"}const playerEntry=event.leaderboard.entries.find(entry=>{return entry.playerEntry===true});if(playerEntry){return"🟢"}for(const stage of event.stages){const stageEntry=stage.leaderboard.entries.find(entry=>{return entry.playerEntry===true});if(stageEntry){return"🟡"}}return"🔴"}function isClubOpen(club){if(club.currentChampionship){return isEventOpen(club.currentChampionship)}return false}function findCurrentEvent(clubInfo){if(isClubOpen(clubInfo)){return clubInfo.currentChampionship.events.find(event=>isEventOpen(event))}return undefined}function staticGetGameData(){return{orderedLocations:[{id:5,value:"RALLY MEDITERRANEO"},{id:6,value:"VODAFONE RALLY DE PORTUGAL"},{id:7,value:"RALLY ITALIA SARDEGNA"},{id:8,value:"RALLY ESTONIA"},{id:9,value:"RALLY SCANDIA"},{id:12,value:"GUANAJUATO RALLY MÉXICO"},{id:13,value:"RALLY CHILE BIO BÍO"},{id:14,value:"AGON BY AOC RALLY PACIFICO"},{id:15,value:"SECTO RALLY FINLAND"},{id:16,value:"CROATIA RALLY"},{id:17,value:"RALLYE MONTE-CARLO"},{id:18,value:"RALLY SWEDEN"},{id:24,value:"EKO ACROPOLIS RALLY GREECE"},{id:25,value:"FORUM8 RALLY JAPAN"},{id:26,value:"SAFARI RALLY KENYA"},{id:27,value:"FANATEC RALLY OCEANIA"},{id:28,value:"RALLY IBERIA"},{id:29,value:"CENTRAL EUROPE RALLY"},{id:30,value:"TET RALLY LATVIA"},{id:31,value:"ORLEN 80TH RALLY POLAND"}],orderedVehicleClasses:[{id:1,value:"H1 (FWD)"},{id:2,value:"H2 (FWD)"},{id:3,value:"H2 (RWD)"},{id:4,value:"H3 (RWD)"},{id:5,value:"Group B (RWD)"},{id:6,value:"Group B (4WD)"},{id:7,value:"NR4/R4"},{id:8,value:"Rally4"},{id:9,value:"S1600"},{id:10,value:"S2000"},{id:11,value:"F2 Kit Car"},{id:12,value:"Group A"},{id:13,value:"World Rally Car 1997 - 2011"},{id:14,value:"Rally2"},{id:17,value:"World Rally Car 2017 - 2021"},{id:19,value:"WRC"},{id:20,value:"JWRC"},{id:21,value:"WRC2"},{id:23,value:"World Rally Car 2012 - 2016"}]}}async function getGameData(token){const options=getOptions(token);const url="https://web-api.racenet.com/api/wrc2023Stats/values";const response=await fetch(url,options);if(response.status===200){const data=await response.json();return data}return undefined}async function getEventLeaderboard(token,clubID,leaderboardId,cumulative=true){const options=getOptions(token);let url=`https://web-api.racenet.com/api/wrc2023clubs/${clubID}/leaderboard/${leaderboardId}?SortCumulative=true&ResultCount=20`;if(!cumulative){url=`https://web-api.racenet.com/api/wrc2023clubs/${clubID}/leaderboard/${leaderboardId}?SortCumulative=false&MaxResultCount=20&FocusOnMe=false&Platform=0`}const response=await fetch(url,options);if(response.status===200){const data=await response.json();return data}return undefined}function progressBar(container,textLabel,current,total){const labelEl=document.createElement("label");labelEl.innerText=`${textLabel} (${current}/${total}) `;labelEl.setAttribute("for","club-download-progress");const progress=document.createElement("progress");progress.setAttribute("id","club-download-progress");progress.value=current;progress.max=total;container.innerHTML="";container.style.width="75%";progress.style.width="100%";container.style.width="100%";container.appendChild(labelEl);container.appendChild(document.createElement("br"));container.appendChild(progress)}function addCssToDocument(css){var style=document.createElement("style");style.setAttribute("type","text/css");style.innerText=css;document.head.appendChild(style)}function getPlace(leaderboard){const playerEntry=leaderboard.entries.find(entry=>{return entry.playerEntry===true});if(playerEntry){return`${playerEntry.rank}/${leaderboard.totalEntrantCount} (${(playerEntry.rank*100/leaderboard.totalEntrantCount).toFixed(0)}%)`}return`-/${leaderboard.totalEntrantCount}`}function getTime(leaderboard){const playerEntry=leaderboard.entries.find(entry=>{return entry.playerEntry===true});if(!playerEntry){return`-`}let diff=`<br/>+(${trimFourZeros(playerEntry.differenceToFirst)})`;if(playerEntry.rank===1){diff="🏁"}return`${trimFourZeros(playerEntry.timeAccumulated)}${diff}`}function getSelfInfo(leaderboard){const playerEntry=leaderboard.entries.find(entry=>{return entry.playerEntry===true});if(!playerEntry){return``}let content=`<p>${db(playerEntry.vehicle)}<b</p>
    2
        <p>${trimFourZeros(playerEntry.timeAccumulated)}</p>
    3
        <p>+(${trimFourZeros(playerEntry.differenceToFirst)})</p>`;if(playerEntry.rank===1){content="<p>🏁</p>"}return`
    4
          <div class="placement-tag">
    5
            ME