Skip to content

Instantly share code, notes, and snippets.

@code2k
Created January 7, 2015 20:15
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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