Teach Lita How to Query the Meetup API

Your meetup finder skill has two major components: a standard Lita handler layer to connect chat users with the meetup API and a model class for standardizing parsing of the meetup API responses. You’ll start with the Lita handler layer.

Open your meetup_finder.rb implementation and add the required meetup_client gem at the top of the file:

 # Load 3rd party meetup API client gem
 require ​'meetup_client'

Next, you’ll set up a handy convention for wrapping normal exceptions in the course of interacting with a remote API.

Create a custom API error class

API clients tend to fail in predictable ways, such as:

  • Bad or missing API key
  • Unable to connect to ...

Get Build Chatbot Interactions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.