Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
An IRC bot with a RESTful HTTP interface, built on Ruby and EventMachine.
Ruby HTML CSS Shell
Branch: formalish_spec

This branch is 17 commits ahead, 6 commits behind pda:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
.gitignore
.rvmrc
Gemfile
README.md
Rakefile
example.json
irc_machine.gemspec

README.md

Agent99

Basic Interaction

( Pushes to branches will trigger builds )

agent99 rebuild contests/features/master

  • Rebuilds the last build of features/master in contests

agent99 deploy contests

  • fetches the head of contests/production, checks it's passed CI and deploys
  • ? Should the production branch be a configurable?

agent99 deploy! contests

  • Deploys the head of production

Old docs

An IRC bot with a RESTful HTTP interface, built on Ruby and EventMachine.

Design philosophy: simple to the point of under-engineered, make it work for the 90% case.

# something like this might work
git clone git://github.com/pda/irc_machine
cd irc_machine
cp example.json irc_machine.json

# run it
./bin/irc_machined run
# ctrl+c

# daemonize it
./bin/irc_machined start
# stop the daemon
./bin/irc_machined stop

# or maybe even this (chances aren't good, though)
gem install irc_machine
irc_machined run

Plugins

Plugins are objects which respond to #receive_line, and would will receive a reference to the IrcMachine::Session when instantiated. It should use that reference to send IRC commands.

Plugins may also implement the RESTful HTTP API by creating routes. The pattern for this would look something like:

def initialize(*args)
  route(:get, "/endpoint", :endpoint)
  super(*args)
end

def endpoint(request, match)
  ok request.body.read
end

Configuration

You should copy example.json to irc_machine.json, or set IRC_MACHINE_CONF to the name of the config file.

Plugins are enabled by their class name specified in the plugins array, everything under irc_machine/plugin will be loaded at boot time, however.

Default Plugin

IrcMachine ships with a plugin to demonstrate the REST API. It listens on port 8421 by default. And you can't change the default.

  • GET /channels returns a JSON list of channels the bot is probably in.
  • PUT /channels/{name} joins a channel.
  • DELETE /channels/{name} parts a channel.
  • POST /channels/{name} sends a text/plain message to a channel, auto-joins if required.
  • POST /channels/{name}/github accepts GitHub post-receive hook notifications, notifies channel.

Contributors

Meh.

© Paul Annesley, 2011, MIT license

Something went wrong with that request. Please try again.