- By Sean Bryant
- https://github.com/sbryant/rb-clubot
rb-clubot is a simple Client interface for interacting with clubot. See Clubot for more information on running a clubot.
If you're using bundler just add the gem to your Gemfile:
gem 'clubot', :git => "git://github.com/sbryant/rb-clubot.git"
I should have this submitted to rubygems when clubot is more complete.
Using clubot is incredibly easy and the easiest way to understand clubot is to see an example of using clubot.
require 'clubot'
client = Clubot::Client.new
client.connect
# Make a blocking request
client.request "type" => "nick" do |data|
puts "Got data: #{data}"
end
# Poll for IRC broadcasts
loop do
ins, out, err = ZMQ.select([client.sub_sock])
ins.each do |i|
# We use multipart messages to make subscriptions easier.
header = i.recv
json = i.recv
puts "Got Header #{header}"
puts "Got json #{json}"
end
end
Just fork and send a pull requests.