Skip to content

Instantly share code, notes, and snippets.

@je4npw
Created November 5, 2024 20:19
Show Gist options
  • Save je4npw/c6e40b82de9afc1a6adaa214376e5a99 to your computer and use it in GitHub Desktop.
Save je4npw/c6e40b82de9afc1a6adaa214376e5a99 to your computer and use it in GitHub Desktop.
(async function(){
const UNFOLLOW_LIMIT = 800
const delay = (ms) => new Promise(_ => setTimeout(_, ms))
const findButton = (txt) => [...document.querySelectorAll("button").entries()].map(([pos, btn]) => btn).filter(btn => btn.innerText === txt)[0]
console.log("Start")
for (let i = 0; i < UNFOLLOW_LIMIT; i++) {
const $next = findButton("Seguindo")
if (!$next) { continue }
$next.scrollIntoViewIfNeeded()
$next.click()
await delay(100)
$confirm = findButton("Deixar de seguir")
if ($confirm) {
$confirm.click()
}
await delay(20 * 1000) // Aguarde 20s, 200 unfollows é o limite por hora
console.log(`Unfollowed #${i}`)
}
console.log("Fim")
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment