diff --git a/index.ts b/index.ts index eee0a97..4b85497 100644 --- a/index.ts +++ b/index.ts @@ -38,15 +38,21 @@ async function getPatchHrefs() { const allPatches = await getPatchHrefs(); -const patchRequests = allPatches.map((testPatchUrl) => +const patchRequests = allPatches.map((url) => (async () => { - const req = await fetch(testPatchUrl); + const req = await fetch(url); const data = parse(await req.text()); - return data.getElementsByTagName("h1")[0].nextElementSibling?.innerText; + return { + url, + description: + data.getElementsByTagName("h1")[0].nextElementSibling?.innerText, + }; })(), ); const dirtyPatchDescriptions = await Promise.all(patchRequests); -const patchDescriptions = dirtyPatchDescriptions.filter((e) => e) as string[]; +const patchDescriptions = dirtyPatchDescriptions.filter( + ({ description }) => description, +) as { url: string; description: string }[]; console.log(patchDescriptions);