rduarte (owner)

Revisions

gist: 110826 Download_button fork
public
Public Clone URL: git://gist.github.com/110826.git
bot.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
requires.sh
1
2
3
gem sources -a http://gems.github.com
sudo gem install twibot
sudo gem install twitter4r