Office Intelligence: Automated Slack Notifications for Coffee & Popcorn
by Nate Welch, on July 28, 2016
Being a fresh engineering intern at a company like Arkatechture involves a lot of self guidance. I can’t just jump onto a client without a deep knowledge of all things data. Much of my first day, like most people’s first days, was spent getting signed up for the many websites that my coworkers use, one of them being the ever popular messaging platform Slack.
If you don’t use Slack in your office, you should consider it. It’s a simple instant messaging app with direct, group, and channel messaging.
The best part about it, though, is integrations.
There are numerous integrations already available to hook up to Slack. JIRA, Google Drive, Lucidchart, and Giphy are a few we use at Arkatechture. Integrations are like plugins for Slack- for example, Giphy.com is a website that has a library of animated GIFs that are searchable by tag. The Slack integration allows you to type something along the lines of “/giphy data” into the Slack message box to send out a random GIF from Giphy with the data tag.
/giphy data
Now the real fun is in custom integrations. Basically you can setup a REST endpoint in Slack that allows you to post to a chat with a custom icon, username, and message.
Naturally, I had to get my hands on it.
But what to do with it? Well as a data company, we like to collect data, even from our coffee maker and popcorn machine.
The coffee maker is designed to begin brewing as soon as you close the reservoir lid. To detect brewing, we put a light sensor on the bottom of the lid so we can see when brewing begins, and the Raspberry Pi the sensor is connected to posts to our database on AWS.
In the same script on the Raspberry Pi that posts to the database, I added a POST to a custom Slack integration.
Now whenever we make coffee or popcorn everyone gets the memo!
Here’s what it looks like in Slack:
Pretty neat huh? Feel free to check out the code here on my GitHub account, now go build your own Slack integration!