Socket
Book a DemoInstallSign in
Socket

chatroid

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chatroid

0.1.3
bundlerRubygems
Version published
Maintainers
1
Created
Source

Chatroid

Chatroid is a gem for quickly creating chatterbot in Ruby.

Installation

$ gem install chatroid

Requirements

  • Ruby >= 1.9

Supported

  • IRC
  • Twitter
  • Campfire
  • xmpp (Google Talk, HipChat, ...)

Example

For more examples, please see examples.

require "chatroid"

Chatroid.new do
  set :service,         "Twitter"
  set :consumer_key,    ENV["CONSUMER_KEY"]
  set :consumer_secret, ENV["CONSUMER_SECRET"]
  set :access_key,      ENV["ACCESS_KEY"]
  set :access_secret,   ENV["ACCESS_SECRET"]

  on_tweet do |event|
    if event["text"] =~ /chatroid/
      favorite event
    end
  end

  on_reply do |event|
    reply "Hi, i am a chatroid", event
  end

  on_time :hour => 12, :min => 0, :sec => 0 do
    tweet "Hello, world!"
  end
end.run!

Deploy to Heroku

  • Create Procfile, Gemfile, and bot.rb
  • Execute bundle install
  • Create app on Heroku
  • Configure environment variables
  • Deploy app
$ gem install heroku
$ heroku login

$ mkdir bot
$ cd !$
$ echo "bot: bundle exec ruby bot.rb" >> Procfile
$ echo "source :rubygems" >> Gemfile
$ echo "gem 'chatroid'"   >> Gemfile
$ vim bot.rb
$ bundle install
$ heroku create your_favorite_bot_name --stack cedar
$ heroku config:add CONSUMER_KEY=... CONSUMER_SECRET=... ACCESS_KEY=... ACCESS_SECRET=...
$ git push heroku master
$ heroku ps:scale bot=1

FAQs

Package last updated on 15 Jul 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.