Cleaning up after a twitter hack, with Unix

My twitter account got hacked. I needed a way to bulk unfollow the 700 accounts I was now following. I installed the command line twitter client twidge and used a little shell-fu to unfollow 20 accounts at a time

I then looped it automatically with the watch command, resulting in

This unfollowed the newest accounts first, so I was able to catch it before it unfollowed the accounts I really care about.