Keep track of Twitter "unfollowers"
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
#!/bin/sh | |
# track unfollows on twitter using "t" https://github.com/sferik/t | |
# usage: | |
# | |
# to check if any of your followers has stopped following you since the last | |
# time the script wall called, use: | |
# $ this_script followers | |
# | |
# to check if YOU stopped following someone (it appears many of us witnessed | |
# this behaviour in twitter), use: | |
# $ this_script followings | |
# | |
# replace the following email address with your own | |
rcpt="your@email.net" | |
if [ $# -lt 1 ]; then | |
echo "$0 <followers|followings>" | |
exit 1 | |
fi | |
PATH=${PATH}:/usr/local/bin | |
tfollow="/tmp/t${1}.lst" | |
flist=`t ${1}|sort` | |
rec_follows() { | |
echo "${flist}" >${tfollow} | |
exit 0 | |
} | |
[ ! -f "${tfollow}" ] && rec_follows | |
fdiff="`echo \"${flist}\"|diff -u ${tfollow} -`" | |
if [ ! -z "${fdiff}" ]; then | |
echo "${fdiff}"|grep ^-[^\ -] | | |
mail -s "Unfollowed ${1} on Twitter!" "${rcpt}" | |
rec_follows | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment