<commit_before>= Blather

An evented XMPP library

== Features

* evented architecture
* uses <strike>libxml</strike> Nokogiri
* simplified starting point

== Project Pages

Blather:: https://sprsquish.github.com/blather

GitHub:: https://github.com/sprsquish/blather

GitHub Docs:: http://docs.github.com/sprsquish/blather

RubyForge:: http://rubyforge.org/projects/squishtech

RDocs:: http://squishtech.rubyforge.org/blather

= Usage

== Installation

  sudo gem install blather

== Example

See the /examples directory for more advanced examples.

This will auto-accept any subscription requests and echo back any chat messages.

  require 'rubygems'
  require 'blather/client'

  setup '<EMAIL>', 'echo'

  # Auto approve subscription requests
  subscription :request? do |s|
    write s.approve!
  end

  # Echo back what was said
  message :chat?, :body do |m|
    write m.reply
  end

== Handlers

Setup handlers by calling their names as methods.

  # Will only be called for messages where #chat? responds positively
  # and #body == 'exit'
  message :chat?, :body => 'exit'

=== Handler Guards

Guards act like AND statements. Each condition must be met if the handler is to be used.
<commit_msg>more readme changes<commit_after>= Blather

XMPP DSL (and more) for Ruby written on EventMachine and Nokogiri.

== Features

* evented architecture
* uses Nokogiri
* simplified starting point

== Project Pages

Blather:: https://sprsquish.github.com/blather

GitHub:: https://github.com/sprsquish/blather

GitHub Docs:: http://docs.github.com/sprsquish/blather

RubyForge:: http://rubyforge.org/projects/squishtech

RDocs:: http://squishtech.rubyforge.org/blather

= Usage

== Installation

  sudo gem install blather

== Example

See the examples directory for more advanced examples.

This will auto-accept any subscription requests and echo back any chat messages.

  require 'rubygems'
  require 'blather/client'

  setup '<EMAIL>', 'echo'

  # Auto approve subscription requests
  subscription :request? do |s|
    write s.approve!
  end

  # Echo back what was said
  message :chat?, :body do |m|
    write m.reply
  end

== Handlers

Setup handlers by calling their names as methods.

  # Will only be called for messages where #chat? responds positively
  # and #body == 'exit'
  message :chat?, :body => 'exit'

=== Handler Guards

Guards act like AND statements. Each condition must be met if the handler is to be used.

{'fraction_non_alphanumeric': 0.09564860426929392, 'fraction_numerical': 0.0, 'mean_word_length': 3.953252032520325, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '3540788', 'n_tokens_mistral': 792, 'n_tokens_neox': 743, 'n_words': 270}