Created
October 26, 2021 15:15
-
-
Save jonnyparris/19aa969b857f0a354ecd8aac5c1d97b7 to your computer and use it in GitHub Desktop.
Spamming with a rate limit
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
function sleep(ms) { | |
return new Promise((resolve) => setTimeout(resolve, ms)); | |
} | |
const sleepyLoop = async() => { | |
for (const [index, url] of urls.entries()) { | |
spam(url, index) | |
await sleep(100) | |
} | |
} | |
sleepyLoop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment