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 100 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

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