Skip to content

Instantly share code, notes, and snippets.

@eolszewski
Created July 31, 2019 17:01
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save eolszewski/cc651b72e36a4f0e2c5ab8307d1ecee8 to your computer and use it in GitHub Desktop.
Save eolszewski/cc651b72e36a4f0e2c5ab8307d1ecee8 to your computer and use it in GitHub Desktop.
Unfollow everyone you're currently following on Twitter
// ====================
// UPDATED JULY 31, 2019
// ====================
// Unfollow everyone, by Eric Olszewski (https://twitter.com/hrdwrknvrstps)
//
// 1. Go to https://twitter.com/YOUR_USER_NAME/following
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac)
// 3. Paste this into the Developer Console and run it
// Note: Twitter
(() => {
const method = () => {
const group = Array.from(document.querySelectorAll('[data-testid$="-unfollow"]'));
if (group.length > 0) {
group.forEach((btn) => btn.click());
const confirms = Array.from(document.querySelectorAll('[data-testid="confirmationSheetConfirm"]'));
confirms.forEach((btn) => btn.click());
window.scrollBy(0,80*group.length);
setTimeout(method, 2000);
} else {
console.log('Done');
}
};
method();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment