cleverbot.io

To install this package, you can use either RubyGems or Bundler.

RubyGems

To use RubyGems to install this package, enter the following in your console

gem install cleverbot_io

Bundler

If using Bundler to install this package, add the following to your application's Gemfile:

gem('cleverbot_io')

And then execute the following in your console

bundle install

Before using this module, please get your API keys at http://cleverbot.io/keys.

To initialize the Cleverbot, require the module and create a new instance:

require 'cleverbot'

bot = Cleverbot.new('YOUR_API_USER', 'YOUR_API_KEY')

cleverbot.io allows you to save cleverbot sessions to access later. To utilize this feature, you can create a new instance with a third parameter.

require 'cleverbot'

bot = Cleverbot.new('YOUR_API_USER', 'YOUR_API_KEY', 'sessionname')

Now querying the cleverbot is simple, you pass the text to the #say method

bot.say('Just a small town girl')
# => Living in a lonely world

Well, that's it for now! Happy hacking!