oh boy.
parent
390b4029b4
commit
91fe0edfcd
34
index.ts
34
index.ts
|
@ -12,22 +12,28 @@ async function getPatchHrefs() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[...Array(7).keys()]
|
return (
|
||||||
.map((val) => ++val)
|
await Promise.all(
|
||||||
.map(async (page) => {
|
[...Array(7).keys()]
|
||||||
const req = await fetch(getGalleryPageHref(page));
|
.map((val) => ++val)
|
||||||
const data = parse(await req.text());
|
.map((page) => {
|
||||||
|
return (async () => {
|
||||||
|
const req = await fetch(getGalleryPageHref(page));
|
||||||
|
const data = parse(await req.text());
|
||||||
|
|
||||||
const gallery = data
|
const gallery = data
|
||||||
.getElementsByTagName("div")
|
.getElementsByTagName("div")
|
||||||
.filter((el) => el.classList.contains("hds-gallery-items"))
|
.filter((el) => el.classList.contains("hds-gallery-items"))
|
||||||
.shift();
|
.shift();
|
||||||
|
|
||||||
return gallery
|
return gallery
|
||||||
?.getElementsByTagName("a")
|
?.getElementsByTagName("a")
|
||||||
.map((el) => el.getAttribute("href"))
|
.map((el) => el.getAttribute("href"))
|
||||||
.filter((el) => el) as string[];
|
.filter((el) => el) as string[];
|
||||||
});
|
})();
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
).flat();
|
||||||
}
|
}
|
||||||
|
|
||||||
const allPatches = await getPatchHrefs();
|
const allPatches = await getPatchHrefs();
|
||||||
|
|
Loading…
Reference in New Issue