Compare commits
2 Commits
3f374303a4
...
64b693e1e5
Author | SHA1 | Date |
---|---|---|
Zynh0722 | 64b693e1e5 | |
Zynh0722 | 814ae312b0 |
20
index.ts
20
index.ts
|
@ -14,8 +14,8 @@ async function getPatchHrefs() {
|
||||||
|
|
||||||
const hrefRequests = [...Array(7).keys()]
|
const hrefRequests = [...Array(7).keys()]
|
||||||
.map((val) => ++val)
|
.map((val) => ++val)
|
||||||
.map((page) => {
|
.map((page) =>
|
||||||
return (async () => {
|
(async () => {
|
||||||
const req = await fetch(getGalleryPageHref(page));
|
const req = await fetch(getGalleryPageHref(page));
|
||||||
const data = parse(await req.text());
|
const data = parse(await req.text());
|
||||||
|
|
||||||
|
@ -28,8 +28,8 @@ async function getPatchHrefs() {
|
||||||
?.getElementsByTagName("a")
|
?.getElementsByTagName("a")
|
||||||
.map((el) => el.getAttribute("href"))
|
.map((el) => el.getAttribute("href"))
|
||||||
.filter((el) => el) as string[];
|
.filter((el) => el) as string[];
|
||||||
})();
|
})(),
|
||||||
});
|
);
|
||||||
|
|
||||||
const hrefLists = await Promise.all(hrefRequests);
|
const hrefLists = await Promise.all(hrefRequests);
|
||||||
|
|
||||||
|
@ -38,4 +38,14 @@ async function getPatchHrefs() {
|
||||||
|
|
||||||
const allPatches = await 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);
|
||||||
|
|
Loading…
Reference in New Issue