Last active
September 7, 2021 18:42
-
-
Save gforien/390cac987055901708cef91089bc8865 to your computer and use it in GitHub Desktop.
Delete all my youtube comments
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
// on https://myactivity.google.com/page?page=youtube_comments | |
let i = 0 | |
let total = document.querySelectorAll("div[role=list] button").length | |
let recurse = () => { | |
setTimeout(() => { | |
let a = document.querySelectorAll("div[role=list] button") | |
let b = document.querySelectorAll("div[role=list] h2")[i].innerHTML.padEnd(13) | |
if (a[i]) { | |
i++ | |
a[i].click() | |
console.log(`commentaire du ${b} supprimé (${a.length-1} restants /${total})`) | |
recurse() | |
} else { | |
console.error(`plus de commentaires`) | |
} | |
}, 5000 + Math.round(Math.random()*3000)) | |
} | |
recurse() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment