From 64b693e1e5682b782f7c367aef38d4d8581d1d74 Mon Sep 17 00:00:00 2001 From: Zynh0722 Date: Tue, 2 Apr 2024 23:42:46 -0700 Subject: [PATCH] getting all descriptions --- index.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index ead1e87..3acaf9c 100644 --- a/index.ts +++ b/index.ts @@ -38,4 +38,14 @@ async function getPatchHrefs() { const allPatches = await getPatchHrefs(); -console.log(allPatches); +const patchRequests = allPatches.map((testPatchUrl) => + (async () => { + const req = await fetch(testPatchUrl); + const data = parse(await req.text()); + return data.getElementsByTagName("h1")[0].nextElementSibling?.innerText; + })(), +); + +const patchDescriptions = await Promise.all(patchRequests); + +console.log(patchDescriptions);