From bba3c09ebb59e247ce498fb706ee2a6a6e0b8239 Mon Sep 17 00:00:00 2001 From: Simon Lecoq <22963968+lowlighter@users.noreply.github.com> Date: Tue, 15 Mar 2022 01:01:23 +0100 Subject: [PATCH] fix(plugins/statlists): always return 0 lists (#943) --- source/plugins/starlists/index.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/plugins/starlists/index.mjs b/source/plugins/starlists/index.mjs index 94a8bf74..7b58a64e 100644 --- a/source/plugins/starlists/index.mjs +++ b/source/plugins/starlists/index.mjs @@ -20,13 +20,13 @@ export default async function({login, q, imports, data, account}, {enabled = fal //Fetch star lists console.debug(`metrics/compute/${login}/plugins > starlists > fetching lists`) await page.goto(`https://github.com/${login}?tab=stars`) - let lists = (await page.evaluate(() => [...document.querySelectorAll("[href^='/stars/lowlighter/lists']")].map(element => ({ + let lists = (await page.evaluate(login => [...document.querySelectorAll(`[href^='/stars/${login}/lists']`)].map(element => ({ link:element.href, name:element.querySelector("h3")?.innerText ?? "", description:element.querySelector("span")?.innerText ?? "", count:Number(element.querySelector("div")?.innerText.match(/(?\d+)/)?.groups.count), repositories:[], - })) + })), login )) const count = lists.length console.debug(`metrics/compute/${login}/plugins > starlists > found [${lists.map(({name}) => name)}]`)