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