jondot / prophet

Shoutbot alternative. Always stays on, works on MRI or JRuby.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prophet

Prophet is a low traffic runtime messaging framework (look at it as a Shoutbot on steroids). Prophet asynchronously takes your announcements (application side) and forwards them to different notifiers (endpoints). With Prophet you can make sure that your announcements are available via every channel available at once, at the convinience of your clients/users.

This work is still forming up, so beware of sharp edges.

Prophet makes some assumptions on your directory structure in order to discover endpoint plugins:

+ prophet.rb
  + endpoints
    + bot                   # this is the keyword you use in your configuration 'bot', 'jabber'
      - bot_endpoint.rb     # must have Endpoint#create, that takes an options hash.

The configuration DSL is much inspired from Sinatra and Isaac.

Currently you can use Prophet over IRC and tweeter. Jabber and Email are also in planning.

Dependencies

The BotEndpoint notifier depends on isaac (for IRC). so for now, $ gem install issac

The TwitterEndpoint notifier depends on tweeter.

$ gem install tweeter
on jruby, also: $ gem install jruby-openssl

usage

simple:

#configure your endpoints. currently only irc (bot) is allowed
@p = Prophet.new do
    bot 'localhost:2099' do
        config :nick => 'botty_xyz', :server => 'irc.freenode.net', :channel=>'#botty'
        on :announce do |msg|
            msg.upcase
        end
    end
    twitter 'localhost:2098' do
       config :user => 'tweety', :password => 'tweety!'
       on :announce do |msg|
           msg.downcase
       end
    end
    #bot 'foo:2099' do
    #	config :nick => 'foop', :server => 'irc.foo.net'
    #	on :announce do
    #		msg.upcase
    #	end
    #end
    #not implemented yet
    #jabber 'localhost:2093' do
    #	config :user => 'u', :password => 'p'
    #	on :announce do
    #		erb msg, :newmsg
    #	end
    #end
end
# spawn up endpoints
@p.up!
# few minutes later
@p.connect!
# in your application
@p.announce 'Hello, crewl world!'

About

ideas? <dotan@paracode.com>

About

Shoutbot alternative. Always stays on, works on MRI or JRuby.


Languages

Language:Ruby 100.0%