Created
February 20, 2012 12:26
-
-
Save no6v/1868998 to your computer and use it in GitHub Desktop.
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
# http://d.hatena.ne.jp/sugyan/20120219/1329623605 | |
Earthquake.init do | |
command :reduce_friends do | |
catch(:q) do | |
puts "YOU MAY LOSE YOUR ALL FRIENDS WHILE IDLING THE DAY AWAY".c(:notice) | |
until (friends = twitter.friends(page = (page ||= 0).next)).empty? | |
friends.shuffle.each do |friend| | |
name = friend["name"] | |
screen_name = friend["screen_name"] | |
begin | |
answer = Timeout.timeout(4){ | |
ask("Unfollow #{name} @#{screen_name} ? [Y, n, q]: ") | |
} | |
case answer.downcase | |
when ?q | |
throw :q | |
when ?n | |
next | |
end | |
rescue Timeout::Error | |
end | |
input(":unfollow #{screen_name}") | |
end | |
end | |
end | |
end | |
help :reduce_friends, "reduces friends half-forcibly" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment