Skip to content

Instantly share code, notes, and snippets.

@jonnyparris
Created October 26, 2021 15:15
Show Gist options
  • Save jonnyparris/19aa969b857f0a354ecd8aac5c1d97b7 to your computer and use it in GitHub Desktop.
Save jonnyparris/19aa969b857f0a354ecd8aac5c1d97b7 to your computer and use it in GitHub Desktop.
Spamming with a rate limit
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