Skip to content
Ruby clubot client bindings.
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
.gitignore
Gemfile
README.md
clubot.gemspec

README.md

rb-clubot: Simple ruby bindings for clubot.

Description

rb-clubot is a simple Client interface for interacting with clubot. See Clubot for more information on running a clubot.

Installation

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.

Usage:

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

Contribute

Just fork and send a pull requests.

Something went wrong with that request. Please try again.