<commit_before>Kris
================================================================================

IRC bot library - Pluggable, and very simple

[![Dependency Status](https://gemnasium.com/Tomohiro/kris.png)](https://gemnasium.com/Tomohiro/kris)
[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/Tomohiro/kris)
[![endorse](http://api.coderwall.com/tomohiro/endorsecount.png)](http://coderwall.com/tomohiro)


---


Requirements
--------------------------------------------------------------------------------

- Ruby 1.9.3 or lator
- Zircon


Getting started
--------------------------------------------------------------------------------


### Bot project structure

    my-bot-project
        |-- Gemfile
        |-- Procfile
        |-- MyBot
        `-- plugin
            |-- reply.rb
            `-- crawler.rb


### Install the kris

RubyGems.org

Coming soon...


Gemfile

    gem 'kris', :git => 'git://github.com/Tomohiro/kris.git'


### Bootstarp Bot

    $ vi my-bot-project/MyBot

```ruby
#!/usr/bin/env ruby

require 'kris'

Kris::Session.new(
  :server   => 'chat.freenode.net',
  :port     => 6667,
  :channel  => '#my-bot-channel',
  :nickname => 'MyBot',
  :username => 'MyBot',
  :realname => 'MyBot'
).start
```


### Plugin example

Response

```ruby
class Reply < Kris::Plugin
  def response(message)
    case message.body.downcase
    when /hello/
      reply(message.to, message.from, 'Hello!')
    end
  end
end
```

Notification

```Crawler
class Crawler < Kris::Plugin
  def notify
    crawl_datas do |new_data|
      notice('#notify-channel', new_data)
    end<commit_msg>fix format<commit_after>Kris
================================================================================

IRC bot library - Pluggable, and very simple

[![Dependency Status](https://gemnasium.com/Tomohiro/kris.png)](https://gemnasium.com/Tomohiro/kris)
[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/Tomohiro/kris)
[![endorse](http://api.coderwall.com/tomohiro/endorsecount.png)](http://coderwall.com/tomohiro)


---


Requirements
--------------------------------------------------------------------------------

- Ruby 1.9.3 or lator
- Zircon


Getting started
--------------------------------------------------------------------------------


### Bot project structure

    my-bot-project
        |-- Gemfile
        |-- Procfile
        |-- MyBot
        `-- plugin
            |-- reply.rb
            `-- crawler.rb


### Install the kris

RubyGems.org

Coming soon...


Gemfile

    gem 'kris', :git => 'git://github.com/Tomohiro/kris.git'


### Bootstarp Bot

    $ vi my-bot-project/MyBot

```ruby
#!/usr/bin/env ruby

require 'kris'

Kris::Session.new(
  :server   => 'chat.freenode.net',
  :port     => 6667,
  :channel  => '#my-bot-channel',
  :nickname => 'MyBot',
  :username => 'MyBot',
  :realname => 'MyBot'
).start
```


### Plugin example

Response

```ruby
class Reply < Kris::Plugin
  def response(message)
    case message.body.downcase
    when /hello/
      reply(message.to, message.from, 'Hello!')
    end
  end
end
```

Notification

```ruby
class Crawler < Kris::Plugin
  def notify
    crawl_datas do |new_data|
      notice('#notify-channel', new_data)
    end
{'fraction_non_alphanumeric': 0.28807339449541286, 'fraction_numerical': 0.004281345565749235, 'mean_word_length': 2.097537878787879, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '568837', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1015, 'n_words': 194}