Skip to content

Instantly share code, notes, and snippets.

@code2k
Created January 7, 2015 20:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save code2k/9699169d8df29fc35773 to your computer and use it in GitHub Desktop.
Save code2k/9699169d8df29fc35773 to your computer and use it in GitHub Desktop.
This script will cleanup your following list on Twitter. https://sferik.github.io/t/ needs to be installed.
#!/usr/bin/env bash
#
set -o nounset
set -o errexit
KEEPFILE=`mktemp /tmp/$(basename $0).XXXXXX`
KEEPLIST='Reading'
# create list with people who should not be removed in any case:
t list members $KEEPLIST | sed 's/ /\n/g' | sort -f > $KEEPFILE
# unfollow everyone who is not following back
# every user in $KEEPLIST is filtered from the list
t leaders | sed 's/ /\n/g' | grep -v -f $KEEPFILE | xargs -I {} t unfollow "@{}"
rm $KEEPFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment