Created
January 21, 2024 13:11
-
-
Save hUwUtao/bd4a8a040b2dd07dc1a5867019188c04 to your computer and use it in GitHub Desktop.
simai explode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copy( | |
[...document.querySelectorAll("table")] | |
.slice(1, -3) | |
.flatMap((d) => | |
[...d.querySelector("tbody").querySelectorAll("tr")].map((r) => | |
[...r.querySelectorAll("td")].map((r) => r.innerHTML), | |
), | |
) | |
.map((r) => | |
r[0].startsWith("<a") | |
? [ | |
...( | |
/<a href="\/\/w.atwiki.jp\/simai\/pages\/([^"]*)" title="([^"]*)">/.exec( | |
r[0], | |
) || [] | |
).slice(1), | |
].join(",") | |
: "", | |
) | |
.filter(Boolean) | |
.join("\n"), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment