<commit_before>h1. easy-gtalk-bot

A very easy tool for creating Google Talk bots

h2. It's really easy!

h3. Installation

<code>sudo gem install easy-gtalk-bot</code>

h3. Usage

<pre>
require 'easy-gtalk-bot'

bot = GTalk::Bot.new(:email => "<EMAIL>", :password => '<PASSWORD>')
bot.get_online

bot.on_invitation do |inviter|
  puts "I have been invited by #{inviter}. Yay!"

  # do something useful

  bot.accept_invitation(inviter)
  bot.message(inviter, "Hello there! Thanks for invitation!")
end

bot.on_message do |from, text|
  puts "I got message from #{from}: '#{text}'"

  # do something useful

  bot.message from, "I heard that!"
end

# Don't be confused with the name of this method. 
# We actually keep the current (main) thread alive while letting listener thread to do its job.
# So we have no need to set up an any infinite loop.
Thread.stop</pre>

h2. To-do<commit_msg>Updating README<commit_after>h1. easy-gtalk-bot

A very easy tool for creating Google Talk bots

h2. It's really easy!

h3. Installation

<code>sudo gem install easy-gtalk-bot</code>

h3. Usage

h4. Getting online
<pre>require 'easy-gtalk-bot'

bot = GTalk::Bot.new(:email => "<EMAIL>", :password => '<PASSWORD>')
bot.get_online
</pre>

h4. On invitation
<pre>bot.on_invitation do |inviter|
  puts "I have been invited by #{inviter}. Yay!"

  # do something useful

  bot.accept_invitation(inviter)
  bot.message(inviter, "Hello there! Thanks for invitation!")
end
</pre>

h4. On message
<pre>bot.on_message do |from, text|
  puts "I got message from #{from}: '#{text}'"

  # do something useful

  bot.message from, "I heard that!"
end</pre>

h4. Going infinite
<pre># Don't be confused with the name of this method.
# We actually keep the current (main) thread alive while letting listener thread to do its job.
# So we have no need to set up an any infinite loop.
Thread.stop</pre>

h2. To-do
{'fraction_non_alphanumeric': 0.12048832271762208, 'fraction_numerical': 0.0074309978768577496, 'mean_word_length': 4.026666666666666, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 25, 'https://': 0, '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': '6292221', 'n_tokens_mistral': 658, 'n_tokens_neox': 643, 'n_words': 242}