Skip to content

sbryant/rb-clubot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Releases

No releases published

Packages

No packages published

Languages