Skip to content

Instantly share code, notes, and snippets.

@rduarte
Created May 13, 2009 02:00
Show Gist options
  • Save rduarte/110826 to your computer and use it in GitHub Desktop.
Save rduarte/110826 to your computer and use it in GitHub Desktop.
class Array
def shuffle!
size.downto(1) { |n| push delete_at(rand(n)) }
self
end
end
require 'rubygems'
require 'twibot'
configure do |conf|
conf.login = "botname"
conf.password = "twitterpassword"
end
messages=[
"Hi!",
"Leave me alone!",
"How are you?",
]
message do |message, params|
post_tweet "@#{message.sender.screen_name} " + messages.shuffle![0] unless message.sender.screen_name == "botname"
end
reply do |message, params|
post_tweet "@#{message.user.screen_name} " + messages.shuffle![0] unless message.user.screen_name == "botname"
end
gem sources -a http://gems.github.com
sudo gem install twibot
sudo gem install twitter4r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment