Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Ruby clubot client bindings.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 README.md
Octocat-spinner-32 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.