small medium large xlarge

Build Chatbot Interactions: Responsive, Intuitive Interfaces with Ruby


Cover image for Build Chatbot Interactions

Build Chatbot Interactions

Responsive, Intuitive Interfaces with Ruby


The next step in the evolution of user interfaces is here. Chatbots let your users interact with your service in their own natural language. Use free and open source tools along with Ruby to build creative, useful, and unexpected interactions for users. Take advantage of the Lita framework’s step-by-step implementation strategy to simplify bot development and testing. From novices to experts, chatbots are an area in which everyone can participate. Exercise your creativity by creating chatbot skills for communicating, information, and fun.

Choose Your Format(s)

  • $19.95 In Stock
    • Beta: What do I get?

  • Ebooks are DRM free.

  • Ebook delivery options.

  • The Paper Book will ship on 2019-05-10 (roughly).

About this Title

Pages: 200 (est)
Published: 2019-05-10
Release: B9.0 (2019-04-01)
ISBN: 978-1-68050-632-7

Developers of all skill levels can craft user experiences that are natural, easy to use, and most of all, fun. Build chatbots using free, open source tools and launch them to popular chat platforms like Slack and Amazon’s Alexa. Use the Ruby programming language and the Lita bot framework to unlock fun and powerful chat abilities such as sending text messages and emails, creating new meme images, driving a robot around the room, and talking out loud on a home speaker.

Use frameworks available in Ruby and Node.js to get started quickly. Create simple chatbot skills that respond quickly to basic requests. Chain skills together for more complex interactions. Take advantage of test-driven development techniques to build your bots with confidence. Coordinate tasks with colleagues via bot. Connect with external APIs to provide users with data they need. Extract data information from web pages when an API isn’t available. Expand your bot’s reach with SMS and e-mail messaging. Deploy a chatbot to a host so users can interact with it on their schedule.

Build a more responsive, easy-to-use interface for your users today.

What You Need

You don’t need much to get started with chatbots. A Mac or Linux computer with a recent version of Ruby is recommended. Windows users can keep up with a free virtual machine running Linux. You’ll deploy your chatbots for free (or at least cheaply) on cloud hosting platforms like Heroku and Digital Ocean.

Contents & Extracts

This book is currently in beta, so the contents and extracts will change as the book is developed.

  • Preface
    • Who Is This Book For?
    • What’s In This Book?
    • What You Need
    • Why Lita and Ruby?
    • Online Resources
    • Acknowledgements
  • Your First Lita Bot
    • Download the Lita Gem
    • Generate a new Lita bot with lita new
    • Test the bot locally
  • Your First Lita Skill
    • Generate an Empty Skill
    • Complete Your Skill and Write Some Unit Tests
    • Publish Your Skill for Others as a Ruby Gem
    • Wrap-up
  • Deploy Your Lita Bot to Heroku
    • Prepare a Heroku Home for Your Bot
    • Add-ons and Heroku’s Elements Marketplace
    • Wrap-up
  • Deploy Lita on Your Linux Server
    • Create a Cloud Virtual Machine
    • Review and Run the Bootstrap Script
    • Review Your Dockerized Bot via SSH
    • Summary
  • Parse a Photoblog: What’s Brad Eating?
    • The Plan for Building this Skill
    • Implementation
    • Wrap-up
  • Meetup
  • Imgflip Meme Maker
    • Make an Image Macro
    • Teach Lita How to Generate Memes
    • Expand the Skill to Support More Than One Meme
    • Enable Users to Add Memes to Your Gem
    • Wrap-up
  • Bot Task Scheduler excerpt
    • Capture a Lita Command to Reuse Later
    • Resubmit a Deferred Lita Command
    • Store Scheduled Tasks in Redis
    • Wrap-Up
    • Challenges
  • Hide Walls of Text Behind an Offsite URL
    • Create a Lita Extension to Send Text to the Pastebin API
    • Make a Simple Lit Handler Skill to Use as a Test Driver
    • Wrap-Up
  • Answer Questions with a Markov Chain or Cleverbot
    • Markov Chains: Train Lita to Speak in Someone Else’s Voice
    • Cleverbot: Call in an External AI for Difficult Questions
  • Send Messages with SMS and Email excerpt
    • Use Twilio to Send Text Messages
    • Use SMTP to Send an Emails
    • Wrap Up
  • Bot-focused Tools: Ship It and a Git Version Check
  • Amazon Alexa Integrations
    • Hardware, Simulators, and Alexa Portal Access
    • Register for an Alexa Developer Account
    • Create Your First Skill On The Portal
    • Serve up a “Flash Briefing” Newsfeed for Echo devices
    • Record Messages With a Companion Alexa Skill
    • Building Out a Lita Skill to Take-in Messages from Alexa
    • Wrap-up
  • Sonos Commander: Make Your Speaker Talk and Play Music
    • Notes On Getting the Hardware
    • Build Lita Skills to “Say These Words” and “Play this Sound”
    • Connect a Sonos Proxy to Your Socket Server
    • Wrap-Up: What have you learned?
  • Sphero


Daniel Pritchett is a consulting programmer, speaker, and user group supporter in Memphis, Tennessee. He builds infrastructure tooling for internet companies. If it’s interesting and useful, Daniel wants to help you build it.