Skip to content

Instantly share code, notes, and snippets.

@iMilnb
Last active June 17, 2023 16:14
  • Star 3 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
Save iMilnb/7604f04223d44a3e13af to your computer and use it in GitHub Desktop.
Keep track of Twitter "unfollowers"
#!/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