From 5fd7f26ab71970555592e4597cb697965fe79959 Mon Sep 17 00:00:00 2001 From: EvolutionX <85353424+EvolutionX-10@users.noreply.github.com> Date: Tue, 31 Oct 2023 10:05:22 +0530 Subject: [PATCH] fix: somehow google changed the classname wtf --- .github/workflows/leaderboard-update.yml | 2 +- scripts/getParticipants.js | 2 +- scripts/scrape.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/leaderboard-update.yml b/.github/workflows/leaderboard-update.yml index 6c6acd32..89acae86 100644 --- a/.github/workflows/leaderboard-update.yml +++ b/.github/workflows/leaderboard-update.yml @@ -2,7 +2,7 @@ name: Update Leaderboard on: schedule: - - cron: '*/60 * * * *' + - cron: '0 */2 * * *' workflow_dispatch: jobs: diff --git a/scripts/getParticipants.js b/scripts/getParticipants.js index fe607908..c84f9498 100644 --- a/scripts/getParticipants.js +++ b/scripts/getParticipants.js @@ -37,7 +37,7 @@ export const init = async () => { for (let i = 0; i < profile.length; i++) { await wait(500); if (!profile[i]['isEnrollStatusGood']) continue; - console.log(`Fetching Person ${i + 1}`); + console.log(`Fetching Person ${i + 1} (${profile[i]['name']})`); profile[i]['badges'] = await getBadges(profile[i]['profileLink'], profile[i]['enrollDate']); } // count skills and quests diff --git a/scripts/scrape.js b/scripts/scrape.js index 3b7e0359..7f4002dd 100644 --- a/scripts/scrape.js +++ b/scripts/scrape.js @@ -31,7 +31,7 @@ export const getBadges = async (url, enrollDate) => { badgeName = badgeName.map((elem) => elem.innerText.split("\n").join("")); } - let badgeDate = badgeClass.map((elem) => elem.querySelector("span.ql-body-2")); + let badgeDate = badgeClass.map((elem) => elem.querySelector("span.ql-body-medium")); if (!badgeDate) { console.log("No links found"); return [];