formatting
This commit is contained in:
parent
91fe0edfcd
commit
3f374303a4
1 changed files with 20 additions and 20 deletions
40
index.ts
40
index.ts
|
@ -12,28 +12,28 @@ async function getPatchHrefs() {
|
|||
}
|
||||
}
|
||||
|
||||
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());
|
||||
const hrefRequests = [...Array(7).keys()]
|
||||
.map((val) => ++val)
|
||||
.map((page) => {
|
||||
return (async () => {
|
||||
const req = await fetch(getGalleryPageHref(page));
|
||||
const data = parse(await req.text());
|
||||
|
||||
const gallery = data
|
||||
.getElementsByTagName("div")
|
||||
.filter((el) => el.classList.contains("hds-gallery-items"))
|
||||
.shift();
|
||||
const gallery = data
|
||||
.getElementsByTagName("div")
|
||||
.filter((el) => el.classList.contains("hds-gallery-items"))
|
||||
.shift();
|
||||
|
||||
return gallery
|
||||
?.getElementsByTagName("a")
|
||||
.map((el) => el.getAttribute("href"))
|
||||
.filter((el) => el) as string[];
|
||||
})();
|
||||
}),
|
||||
)
|
||||
).flat();
|
||||
return gallery
|
||||
?.getElementsByTagName("a")
|
||||
.map((el) => el.getAttribute("href"))
|
||||
.filter((el) => el) as string[];
|
||||
})();
|
||||
});
|
||||
|
||||
const hrefLists = await Promise.all(hrefRequests);
|
||||
|
||||
return hrefLists.flat();
|
||||
}
|
||||
|
||||
const allPatches = await getPatchHrefs();
|
||||
|
|
Loading…
Reference in a new issue