Unfollow script

This script will unfollow accounts on twitter that you are following, who have not updated yet in 2010.  YMMV.  Usage: ./unfollow.sh [YOUR_twitter_ account].  You need to sub in your account and password where it say [account] and [password].
#!/bin/sh
curl -x 127.0.0.1:1723 “http://twitter.com/followers/ids/$1.json” > followers
sed -ie “s/\[//g” followers
sed -ie “s/\]//g” followers
sed -ie “s/,/ /g” followers
for i in `cat followers`
do
year=`curl -x 127.0.0.1:1723 “http://twitter.com/users/show/$i.xml&#8221; |grep created_at | tail -1 | cut -d” ” -f10 | cut -d”<” -f1`
if [ -z “$year” ]
then
curl -x 127.0.0.1:1723 –basic –user “[account]:[password]” –data “” “http://twitter.com/friendships/destroy/$i.json&#8221;
else
if [ “$year” != “2010” ]
then
curl -x 127.0.0.1:1723 –basic –user “[account]:[password]” –data “” “http://twitter.com/friendships/destroy/$i.json&#8221;
fi
fi
done
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: