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);
}
@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