Created
March 11, 2015 05:30
-
-
Save aeschright/a348c13e77818651728d to your computer and use it in GitHub Desktop.
Force everyone not on a twitter list to unfollow you
This file contains hidden or 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
After you install and set up the twitter command line tool at https://github.com/sferik/t this script can be used to remove all followers not on a list (called "trusted" in this example). This is useful if you have a public twitter account and you change it to be private. | |
#!/bin/sh | |
#set -x | |
trusted=$( t list members trusted ) | |
followers=$( t followers ) | |
follower_list=$( echo $followers | tr " " "\n" ) | |
i=0 | |
for follower in $follower_list; do | |
if [[ ! "${trusted}" =~ "${follower}" ]]; then | |
echo $follower >> removed_followers | |
t block $follower | |
t delete block $follower | |
i=$(($i + 1)) | |
fi | |
done | |
echo "${i} users are no longer following you" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment