Fix API update issue
This commit is contained in:
@@ -26,7 +26,7 @@ async function main() {
|
|||||||
let i = 0;
|
let i = 0;
|
||||||
for(let challenger of challengerLeague.entries) {
|
for(let challenger of challengerLeague.entries) {
|
||||||
console.log("Entry " + i + "/" + challengerLeague.entries.length + " ...")
|
console.log("Entry " + i + "/" + challengerLeague.entries.length + " ...")
|
||||||
const puuid = await summonerPuuid(challenger.summonerId);
|
const puuid = challenger.puuid;
|
||||||
const challengerGameList = await summonerGameList(puuid, latestPatchTime);
|
const challengerGameList = await summonerGameList(puuid, latestPatchTime);
|
||||||
for(let game of challengerGameList) {
|
for(let game of challengerGameList) {
|
||||||
if(!gameList.includes(game) && !alreadySeenGameList.includes(game)) {
|
if(!gameList.includes(game) && !alreadySeenGameList.includes(game)) {
|
||||||
@@ -103,16 +103,6 @@ async function fetchChallengerLeague() {
|
|||||||
return challengerLeague;
|
return challengerLeague;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function summonerPuuid(summonerId) {
|
|
||||||
const endpoint = `/lol/summoner/v4/summoners/${summonerId}`
|
|
||||||
const url = `${base}${endpoint}?api_key=${api_key}`
|
|
||||||
|
|
||||||
const puuidResponse = await handleRateLimit(new URL(url));
|
|
||||||
handleError(puuidResponse)
|
|
||||||
const puuidJson = await puuidResponse.json();
|
|
||||||
|
|
||||||
return puuidJson.puuid;
|
|
||||||
}
|
|
||||||
async function summonerGameList(puuid, startTime) {
|
async function summonerGameList(puuid, startTime) {
|
||||||
const base = "https://europe.api.riotgames.com"
|
const base = "https://europe.api.riotgames.com"
|
||||||
const endpoint = `/lol/match/v5/matches/by-puuid/${puuid}/ids`;
|
const endpoint = `/lol/match/v5/matches/by-puuid/${puuid}/ids`;
|
||||||
|
|||||||
Reference in New Issue
Block a user