Kazu's Log

Apr 2, 2016

My first Slack bot

Slack is the hipster’s IRC. Honestly speaking I don’t know why people love Slack so much, but Samuel Hulick already wrote Slack, I’m Breaking Up with You that might explain my concerns. So I won’t write about that here.

Anyway Slack has become the new normal, and I wrote a small “bot” that forwards Pivotal Tracker’s updates to Slack.

SIJP-ORG/mercer is the repos. The main index.js file is just 69 lines long. Well, I know that putting everyting in index.js is not so great…

SDKs (service clients)

Unlike Amazon Web Services, Slack itself doesn’t provide SDKs for various languages. There are unofficial SDKs, but I’d like to try the official ones first because it might be less troublesome.

Python and JavaScript (Node) are “supported” by Slack.

So I decided to use node-slack-client because I can’t write Python without googling.

For Pivotal Tracker, there is node-pivotal which is not owned by Pivotal, but introduced at Pivotal’s website. However the library’s doc is linked to the API v3 reference and I’m bit concerned about that.

So I decided to use pivotaltracker instead.

Bluemix instead of Heroku

Before I tended to use Heroku because it was free (as in beer) but the new pricing plan is not great for keeping a Slack bot up.

The new free dynos now allow up to 18 hours of activity in a given 24 hour period for 1 web dyno, 1 worker dyno and 1 one-off dyno started by heroku run or Heroku Scheduler. Your application on free dynos sleeps automatically during quiet periods.

So I decided to use IBM Bluemix instead. Bluemix doesn’t have bluemix command, but you can use Cloud Foundry’s cf command to upload apps to Bluemix.

In other words, Heroku-like services are now somehow standardnized. That is acutally surprising for me!

Cooking my breakfast

Writing a small software is like cooking my breakfast by myself. It is quick and fun, even the quality is just “okay” :)