Skip to content

Instantly share code, notes, and snippets.

@leodutra
Created February 10, 2019 01:40
Show Gist options
  • Select an option

  • Save leodutra/e1b6282b5a17ea29e18cf3ffbac134fd to your computer and use it in GitHub Desktop.

Select an option

Save leodutra/e1b6282b5a17ea29e18cf3ffbac134fd to your computer and use it in GitHub Desktop.
Instagram - auto unfollow
// open "following" on web browser
async function main() {
const buttons = document.querySelectorAll('button')
for (let button of buttons) {
if (button.textContent.trim().toLowerCase() === 'seguindo') {
button.click()
await wait(5000)
const unfollowBtns = document.querySelectorAll('button')
for (let x of unfollowBtns) {
if (x.textContent.trim().toLowerCase() === 'deixar de seguir') {
x.click()
await wait(50)
}
}
}
}
}
async function wait(ms) {
return new Promise(res => setTimeout(res, ms))
}
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment