Skip to content

Instantly share code, notes, and snippets.

@sarthaksavvy
Last active September 27, 2023 07:29
Show Gist options
  • Save sarthaksavvy/88aae5834c1629d49185e88140ae435b to your computer and use it in GitHub Desktop.
Save sarthaksavvy/88aae5834c1629d49185e88140ae435b to your computer and use it in GitHub Desktop.
Automate Unfollow/Follow
Check files inside this gist
let btns = document.querySelectorAll("[data-testid]")
let followBtns = Array.from(btns).filter(btn => {
return btn.getAttribute('data-testid').includes('follow')
})
for (let i = 1; i <= followBtns.length; i++) {
setTimeout(() => {
followBtns[i - 1].click()
}, 1000 * i);
}
let btns = document.querySelectorAll("[data-testid]")
let unfollowBtns = Array.from(btns).filter(btn => {
return btn.getAttribute('data-testid').includes('unfollow')
})
for (let i = 1; i <= unfollowBtns.length; i++) {
setTimeout(() => {
unfollowBtns[i-1].click()
setTimeout(() => {
document.querySelector("[data-testid='confirmationSheetConfirm']").click()
}, 500);
}, 1000 * i);
}
@faruk863
Copy link

Thank You bro !)))

@xD7M
Copy link

xD7M commented Aug 18, 2020

how can set time?

@faruk863
Copy link

how can set time?

This is unFollow code. You can return for Follow code . => https://gist.github.com/JamieMason/7580315

@michelnicholas
Copy link

hey how do we set the actual number instead of using the .length() ? and can we set the pause to our own time

@shchanchel
Copy link

hey , how to get the follow script unlimited?

@CursedSpiderBoi
Copy link

@sarthaksavvy I want to know that i want to make a script that will unfollow everyone that dosnt follow you. How i do that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment