Compare commits

...

2 Commits

Author SHA1 Message Date
Zynh0722 91fe0edfcd oh boy. 2024-04-02 19:58:20 -07:00
Zynh0722 390b4029b4 remove unused var 2024-04-02 19:33:26 -07:00
1 changed files with 20 additions and 16 deletions

View File

@ -12,24 +12,28 @@ async function getPatchHrefs() {
} }
} }
let patchHrefs: string[] = []; return (
await Promise.all(
[...Array(7).keys()]
.map((val) => ++val)
.map((page) => {
return (async () => {
const req = await fetch(getGalleryPageHref(page));
const data = parse(await req.text());
[...Array(7).keys()] const gallery = data
.map((val) => ++val) .getElementsByTagName("div")
.map(async (page) => { .filter((el) => el.classList.contains("hds-gallery-items"))
const req = await fetch(getGalleryPageHref(page)); .shift();
const data = parse(await req.text());
const gallery = data return gallery
.getElementsByTagName("div") ?.getElementsByTagName("a")
.filter((el) => el.classList.contains("hds-gallery-items")) .map((el) => el.getAttribute("href"))
.shift(); .filter((el) => el) as string[];
})();
return gallery }),
?.getElementsByTagName("a") )
.map((el) => el.getAttribute("href")) ).flat();
.filter((el) => el) as string[];
});
} }
const allPatches = await getPatchHrefs(); const allPatches = await getPatchHrefs();