Skip to content

Instantly share code, notes, and snippets.

@nytr0gen
Created June 2, 2021 06:04
Show Gist options
  • Save nytr0gen/2a6a42b33e2fff509717484c1900212d to your computer and use it in GitHub Desktop.
Save nytr0gen/2a6a42b33e2fff509717484c1900212d to your computer and use it in GitHub Desktop.
Twitter Nuclear Unfollow
// 1. Go to your Following page. Mine would be https://twitter.com/nytr0gen_/following
// 2. Run this script in the Console. Change maxUnfollows to anything you want.
// 3. Check in from time to time and run it again if it fails.
sendUnfollow = () => document.querySelector('[data-testid=UserCell] [data-testid*=unfollow] span span').click();
confirmUnfollow = () => document.querySelector('[data-testid=confirmationSheetConfirm] span span').click();
sleep = ms => new Promise(r => setTimeout(r, ms));
i = 0;
maxUnfollows = 1000;
recursiveUnfollow = () => {
if (i++ > maxUnfollows) { return; }
sendUnfollow();
sleep(200).then(() => {
confirmUnfollow();
window.scrollBy(0, 110);
return sleep(200);
}).then(() => recursiveUnfollow());
};
recursiveUnfollow();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment