goodservice.io on Slack and Twitter

Sunny Ng
Good Service
Published in
4 min readMar 12, 2019

The goal of goodservice.io has always been to provide the general public with an insightful and up-to-date status update of the New York City subway system. Up until now, the only way to view this information is to go to the website at goodservice.io. Incremental improvements on the website have made it possible to add any train or line as favorites, as well as the ability to bookmark and view the status of each train or line directly. But, what if you don’t want to fire up your trusty old browser?

goodservice.io on Slack

Many companies have started using Slack for employees to communicate and collaborate with each other. My employer, Harry’s, has been using it for a while now and so has Code Nation, a non-profit organization I have been volunteering with. I thought about when it would be useful in my day-to-day life to view information provided by goodservice.io, it would most often be before or after work. So integrating with a workplace app seemed natural. Thankfully, Slack is very developer-friendly with a pretty established app ecosystem, so I decided to take a stab at creating a Slack app.

The features of the Slack app largely mirrors what is already on the website. Upon installation, you can use the /goodservice command to display the list of available trains and lines.

From then, you can view the status of the train or line you selected. Alternatively, you can type /goodservice delays to view a summary of trains that are identifed as delayed.

It was not too difficult to build the Slack app, as the heavy-lifting part of compiling the data has previously been done for the website. The bulk of the work for the Slack app involved creating a couple of endpoints that would transform the existing precompiled data for the website into a custom JSON format, and configuring these endpoints on Slack’s developers’ interface. It took a weeknight from start to finish. Try out goodservice.io for Slack now!

If you’re a pro, you can even look up subway status directly by route.

@goodservice_io on Twitter

On top of providing more ways to access goodservice.io’s information, I also wanted to create something more active compared to the website; something that would tell me to check the website if there is something is up, but not necessarily overload me with too much information. Notifications when headways are abnormal would be noisy and excessive, since you can still take the subway to get to where you need to go if the headways are long, it would just take longer. Instead, I thought focusing on delays would be a lot more useful. I was also inspired by the official New York City Transit Subway Twitter account as being a helpful resource at informing the public about train delays.

In a previous post, I discussed how goodservice.io was able to detect some instances of delays earlier than the MTA. I thought about using that information to drive the Twitter bot—only tweeting out trains that it detects as delayed. If you need more information, you should check the website for details. I’ve been testing this account for the last couple of weeks, let’s see some examples of some delays it reported.

Keep in mind that goodservice.io’s current definition of a delay is when a train has its arrival time increase by more than 5 minutes between two consecutive stops, and that the Twitter account is only updated once every 10 minutes. It’s live now, follow us (and the automated bot) on Twitter at @goodservice_io.

goodservice.io is an open-source project to provide New York City subway riders a more detailed and up-to-date status page using public APIs. Contributions are welcome on GitHub. Feedback can be directed to @_blahblahblah or @goodservice_io on Twitter.

--

--