Last active
October 3, 2023 15:45
-
-
Save jkmcnk/3dff4d43f418951427235c0012a26034 to your computer and use it in GitHub Desktop.
unfollow everybody on twitter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* go to the list of accounts you follow: | |
* | |
* https://twitter.com/username/following | |
* | |
* open the browser javascript console and paste the following in, followed by a ctrl+enter | |
*/ | |
function clickConfirm() { | |
var goon = 0; | |
var divs2 = document.getElementsByTagName("div"); | |
goon = 0; | |
for(var i = 0; i < divs2.length; i++) { var lbl = divs2[i].getAttribute("data-testid"); if(lbl != null && lbl.startsWith("confirmationSheetConfirm")) { console.log(divs2[i]); divs2[i].click(); goon = 1; } } | |
if(goon) { | |
setTimeout(clickConfirm, 100); | |
} else { | |
setTimeout(clickUnfollows, 100); | |
} | |
} | |
function clickUnfollows() { | |
var goon = 0; | |
var divs = document.getElementsByTagName("div"); | |
for(var i = 0; i < divs.length; i++) { var lbl = divs[i].getAttribute("aria-label"); if(lbl != null && lbl.startsWith("Following ")) { console.log(divs[i]); divs[i].click(); goon = 1; } } | |
if(goon) { | |
setTimeout(clickConfirm(), 100); | |
} else { | |
window.onload = clickUnfollows(); | |
window.location.href = window.location.href; | |
} | |
} | |
window.onload = clickUnfollows(); | |
window.location.href = window.location.href; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment