O'Reilly logo

Building Bots with Node.js by Madan Bhintade, Eduardo Freitas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making the bot a bit smarter

Now that we have added a REST client library, it's time to add some logic to our application in order to interact with the Air France-KLM APIs.

Our bot should be able to provide feedback about flights and routes using the API endpoints previously described.

Let's make some changes to our code to accommodate this. In order to do that, let's add some logic to make sure that the bot is able to process not only the Twitter hashtag but also a flight number.

So we will essentially automate the call to this REST endpoint and parse the response associated with it, returning just some essential bits of that data, but not all of it. Sounds exciting, so let's get started.

We need to automate this endpoint through a REST call. We ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required