Created
September 28, 2018 22:44
-
-
Save viankakrisna/b0b3550b0db2b189985c8404129ec731 to your computer and use it in GitHub Desktop.
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
(async () => { | |
const numbers = Array.from({ length: 329 }, (v, k) => k + 1); | |
var messageList = document.getElementById("messageList"); | |
while (messageList.firstChild) { | |
messageList.removeChild(messageList.firstChild); | |
} | |
for (const number of numbers) { | |
const res = await fetch( | |
window.location.href.replace("page-329", `page-${number}`) | |
); | |
const text = await res.text(); | |
const parser = new DOMParser(); | |
const doc = parser.parseFromString(text, "text/html"); | |
Array.from(doc.querySelectorAll(".message")).forEach(el => | |
messageList.appendChild(el) | |
); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment