Skip to content

Instantly share code, notes, and snippets.

@no6v
Created February 20, 2012 12:26
Show Gist options
  • Save no6v/1868998 to your computer and use it in GitHub Desktop.
Save no6v/1868998 to your computer and use it in GitHub Desktop.
# 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