Skip to content

Instantly share code, notes, and snippets.

@gforien
Last active September 7, 2021 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gforien/390cac987055901708cef91089bc8865 to your computer and use it in GitHub Desktop.
Save gforien/390cac987055901708cef91089bc8865 to your computer and use it in GitHub Desktop.
Delete all my youtube comments
// 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