Display GitHub Status on a Tidbyt
Sometimes it can be fun to get away from managing and organizational stuff and just hack on something for a while. In my case that has meant an impulse Tidbyt purchase with the intention of writing an app for displaying GitHub status in real time.
You can find the code for this application here.
There are some cool default applications for the Tidbyt (stock tracking, calendar, etc) but of course the real reason to own it is to code custom apps for it.
Development Setup
Setting up the development environment was a breeze on a Mac. I needed to:
Install pixlet (a home grown emulator/tool)
Follow the bitcoin tutorial which covers most of the basics for building a moderately complicated application.
Coding
Once that was done it was time to code something that would display GitHub’s status in relatively real time. Most of the HTTP and caching work was already done in the tutorial but I did need to:
Base64 encode my custom GitHub image(s). Reading the image widget docs was helpful in this case.
Modify the JSON parsing so I could cache the JSON response as a string. Luckily, others have written posts on Tidbyt development before me.
Understand that GitHub uses statuspage.io and know that there is an API with some public endpoints you can hit to get this type of information without an API key. I also happen to know our page ID (you can find this from the subscribe to slack link on the GitHub status page).
What does it do?
Once I had all of that I was able to write a pretty simple application to:
Show GitHub status if it was green.
Show impacted services with the color of their impact (Red/Yellow) when they had incidents.
Show a count of impacted services if there was a large outage and more than 4 services were impacted.
Testing and Publishing
Pushing the finished application to my Tidbyt took more work than I expected because pixlet login
didn’t seem to be working at the time. I ended up finding a workaround being to retrieve your API key and device ID from the iPhone application and then run:
pixlet push <device_id> ./github_status.webp -t <api_key> -i GitHubStatus
If you want this application in particular, you can use the above process to install it on your own Tidbyt until the application is published in the public catalog.
Publishing the application publicly has also been a straightforward process (and uses GitHub) but my pull request is still pending approval.
Final Thoughts
So far this has been fun. The Tidbyt itself looks great in my office and coding up applications for it is not hard at all. There were a few rough edges but I would definitely recommend picking one up (although it is a bit pricy) if you are interested in a fun IoT project and have an idea for the display.