I build API Integrations for Laughs

Ben Brown
Ben Brown
Sep 14, 2013 · 3 min read

I have been having some nerdy fun lately building chat bot integrations with the new messaging and file sharing app, Slack. Slack was created by the same folks who made the web game Glitch, many of whom were also previously involved in the creation of Flickr and the web game that predated it. Point being, Slack is pretty rad and fun to use.

All you need to know is that Slack, amongst other things, provides a chat room for my company that can be connected to various external services that can then send and receive messages in the chat room alongside all the real people. I hope my team can use it to work better as an organism by embedding things like peer review into our regular conversation via integrations with Github and our automated deployment system.

The first thing I did was build a bot using Node and hosted on Heroku that would query my Google calendar and respond with the next upcoming scheduled event. I wrote a quick script to parse the provided ICS file, do some time zone conversions, and tied it in to Slack via a simple webhook.

Image for post
Image for post

Voila, @Bot is now in my Slack chat room available to help me and my team at XOXCO stay organized.

But why stop there? It was so easy to build this, I decided to keep going. I added commands to see the day’s full schedule. I added a command that queries Toggl, our time tracking app, and displays a summary of everyone’s billed hours for the week. I even taught the bot to help us choose where to eat lunch.

Image for post
Image for post

Next, I added a JSON (and plain-text) endpoint to the services offered by tableflipper.com, allowing my bot to request a random table flipping GIF on demand. You too can request GIFs by hitting tableflipper.com/json ortableflipper.com/gif. Why?

Why not?

So, tables flipped, I taught the bot about anger and the release thereof:

Image for post
Image for post

Part of doing all of this involved building a Node module to send and receive Slack messages. You can use it too as I have made it available on Github and installable via NPM.

Building things like this is getting easier and easier by the day. Soon the entire world will be controlled by automated deploy scripts, and that is a world I welcome with open arms.


Thoughts and feelings from @XOXCO team members

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store