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.
Build Chatbot Interactions: Responsive, Intuitive Interfaces with Ruby
by Daniel Pritchett
Build Chatbot Interactions
Responsive, Intuitive Interfaces with Ruby
by Daniel Pritchett
Effective teams automate their workflows, and chatbots are one of the best ways to capture and share repeated tasks. Daniel Pritchett is the perfect teacher to get you instantly productive creating chat-integrated automations.
- Avdi Grimm
Head Chef, RubyTapas.com
Daniel Pritchett’s Build Chatbot Interactions is a fantastic, comprehensive guide to getting started with programming your own Lita chatbot. It walks you through the basics of the Lita chatbot framework, how to get it up and running, and includes a wide variety of example applications. From interactions with remote APIs, to scheduled tasks, to rudimentary artificial intelligence, there are interesting and practical examples for everyone. You’ll be inspired to implement your own ideas, and the book will help you figure out how. This book should be your first step after you finish the software’s own documentation.
- Jimmy Cuadra
Every company I have worked at has used ChatOps as a team tradition to work together and be successful. Daniel lays down the foundation for how you can get started building and deploying your first Chatbot. He then walks you through several how-to examples that explain how you can use Chatbots to manage software systems, send sms/email, schedule tasks, and much more. I recommend you get started with Chatbots today!
- Tammy Bütow
Principal SRE, Gremlin
A delightfully comprehensive dive into the world of making chatbots. Great for hobbyists looking to pick up a new skill or professionals who want to build better tooling.
- Randall Koutnik
Senior Software Engineer, Slack
About this Title
Release: P1.0 (2019-06-11)
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 email 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
- Who Is This Book For?
- What’s in This Book?
- What You Need
- Why Lita and Ruby?
- Online Resources
- Your First Lita Bot
- Install Ruby
- Install Shared Libraries and Redis
- Use Redis as Lita’s “Brain”
- Install the Lita Gem
- Generate a New Lita Bot
- 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
- Deploy Your Lita Bot to Heroku
- Prepare a Heroku Home for Your Bot
- Add-ons and Heroku’s Elements Marketplace
- Deploy Lita on Your Linux Server
- Create a Cloud Virtual Machine
- Review and Run the Bootstrap Script
- Review Your Dockerized Bot through SSH
- Parse a Photoblog: What’s Brad Eating?
- Build a Web Page Scraper Skill
- Set Up a Matcher
- Download the Raw HTML with Tumblr
- Parse the Raw HTML with Nokogiri
- Isolate the First Post with a CSS Selector
- Find the Image with Another CSS Selector
- Format the Results to Share with the End User
- Meetup Finder
- Set Up a Meetup.com Account and API Key
- Connect to the Meetup API Using the Meetup Client Gem
- Teach Lita How to Query the Meetup API
- Test Your MeetupFinder Class
- Model the API Response with a Plain Old Ruby Object
- 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
- Bot Task Scheduler excerpt
- Capture a Lita Command to Reuse Later
- Resubmit a Deferred Lita Command
- Store Scheduled Tasks in Redis
- Hide Walls of Text Behind an Offsite URL
- Create a Lita Extension to Send Text to the Pastebin API
- Make a Simple Lita Handler Skill to Use as a Test Driver
- Use a Markov Chain or Cleverbot
- Markov Chain: Train Lita to Speak in Someone Else’s Voice
- Cleverbot: Use an External AI for Difficult Questions
- Send Messages with SMS and Email excerpt
- Use Twilio to Send Text Messages
- Use SMTP to Send an Email
- ChatOps Techniques for Managing Software Systems
- Create a Mini-skill to Check Installed Version
- Test the Command Executor
- Ask Lita to Ship a New Software Release
- 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
- Build Out a Lita Skill to Take in Messages from Alexa
- Hue Programmable Lighting
- Connect a Hue Bridge to Your Computer
- Build a Simple Wrapper for Managing a Bulb
- Control Your Bulbs from Lita
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.