Sha256: 8df0f79afc67d421f40090080fc52c5c7d530edd4b8e517cefce4083fe794b68

Contents?: true

Size: 473 Bytes

Versions: 4

Compression:

Stored size: 473 Bytes

Contents

# example bot that simulates intelligence
# using http://cleverbot.com/ api

require 'hipbot'
require 'cleverbot'
require 'htmlentities'

class CleverHipbot < Hipbot::Bot
  configure do |c|
    c.jid = ENV['HIPBOT_JID']
    c.password = ENV['HIPBOT_PASSWORD']
    c.name = ENV['HIPBOT_NAME']
  end

  cleverbot = ::Cleverbot::Client.new

  on /(.+)/ do |message|
    coder = HTMLEntities.new
    reply(coder.decode(cleverbot.write(message)))
  end
end

CleverHipbot.start!

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hipbot-1.0.0.rc2 examples/cleverbot.rb
hipbot-1.0.0.rc1 examples/cleverbot.rb
hipbot-0.2.0 examples/cleverbot.rb
hipbot-0.1.0 examples/cleverbot.rb