net-irc

Description

IRC library. This is mostly conform to RFC1459 but partly not for convenience.

Installation

Archive Installation

rake install

Gem Installation

gem install net-irc

Features/Problems

  • IRC client (for bot)

  • IRC server (for gateway to webservices)

Synopsis

Client

require “net/irc”

class SimpleClient < Net::IRC::Client def on_privmsg(m) super channel, message = *m if message =~ /Hello/ post NOTICE, channel, “Hello!” end end end

Net::IRC::Client manages channel status and the information is set in @channels. So, be careful to use @channels instance variable and call super surely.

Server

see example/lig.rb

IRC Gateways

There are some gateways connecting to webservices.

  • Lingr

  • Twitter

  • Wassr

If you want to run it, type following:

$ cd ‘ruby -rubygems -e ’print Gem.searcher.find(“net/irc”).full_gem_path+“/examples”‘`

Lingr: $ sudo gem install pit # for configuration $ ./lig.rb

Twitter: $ ./tig.rb

Wassr: $ ./wig.rb

Run as daemon in default. If you want to help:

$ ./lig.rb –help Usage: ./lig.rb [opts] Options: -p, –port [PORT=16669] listen port number -h, –host [HOST=localhost] listen host -l, –log LOG log file -a, –api_key API_KEY Your api key on Lingr –debug Enable debug mode

This library is based on RICE ( arika.org/ruby/rice ) written by akira yamada.

Author

cho45 <[email protected]>

Copyright

Copyright © 2008 cho45

License

Ruby’s