RESTful API exposing TFL data on London underground status in a slack-friendly fashion

Open the project on GitHub!

It all started from:

  • we need a pet project to work on where we can use Golang
  • Slack is cool and it would be nice to integrate with it

And in a few days myself and Oliver Skånberg ended up creating this small Slack integration (still evolving) which is temporarily being served from a nano EC2 instance for cost saving reasons. I tried with a Kubernetes cluster on Google Cloud but for few requests per month it felt like it was a bit overkilling. The concept is simple, you ask for the tube status, and the service will reply with a nice Slack-friendly message.

This is what it looks like:

Example of service response within Slack

To add the integration to your Slack team, you need to push your slack token to this endpoint:

    PUT https://services.thoeni.io/api/slack/token/{yourToken}

The Slack token will be generated when creating the slash command in the custom integrations section of your slack account. The endpoint to configure as target for the slash command is:

    POST https://services.thoeni.io/api/slack/tubestatus

Once this is done, you can call from any channel or private chat the /tube [tubeLine] command (where the tubeLine is optional). The response is not public, so the caller is the only one able to see it. Examples of valid commands are /tube and /tube Bakerloo.

The service is being monitored through Grafana and Prometheus, and the infrastructure should be totally fine in most cases, but should it become overloaded I’ll decide what to do.

Grafana dashboard monitoring the service

Last but not least, the service has been developed for personal use, it’s currently under active development so there might be times when it will be unavailable.