Skip to content

Instantly share code, notes, and snippets.

@berinhard
Created February 4, 2020 03:17
Show Gist options
  • Save berinhard/0088b09ad967556b4fcef3023a7a3122 to your computer and use it in GitHub Desktop.
Save berinhard/0088b09ad967556b4fcef3023a7a3122 to your computer and use it in GitHub Desktop.
var total = 5;
function new_image() {
var url = "https://thispersondoesnotexist.com/image";
window.open(url,'_blank');
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function crawl_images() {
var counter = 0;
while (counter < total){
counter++;
console.log("Abrindo imagen " + counter + " de " + total);
new_image();
await sleep(3000);
}
console.log("Finalizado!")
}
crawl_images();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment