Skip to content

Instantly share code, notes, and snippets.

@rjmacarthy
Last active July 17, 2023 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjmacarthy/c0d6a2b1533bfe640b15289785571f7e to your computer and use it in GitHub Desktop.
Save rjmacarthy/c0d6a2b1533bfe640b15289785571f7e to your computer and use it in GitHub Desktop.
mass unfollow twitter
function unfollow() {
const elements = document.querySelectorAll('[data-testid=cellInnerDiv]')
elements.forEach((element) => {
const buttons = element.querySelectorAll('[role="button"]')
buttons.forEach((button) => {
if (button.innerText === 'Following') {
button.click()
const unfollowButton = document.querySelector('[data-testid="confirmationSheetConfirm"]')
unfollowButton.click()
}
})
})
}
setInterval(unfollow, 1000)
// Keep doom scrolling down to oblivion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment