Skip to content

Instantly share code, notes, and snippets.

@Navdevl
Forked from leodutra/unfollow-instagram.js
Created April 13, 2020 11:15
Show Gist options
  • Select an option

  • Save Navdevl/353447dc07d44114856984f04e72f5f9 to your computer and use it in GitHub Desktop.

Select an option

Save Navdevl/353447dc07d44114856984f04e72f5f9 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