On the Atlassian Marketplace team, we have a daily standup at 10:30 a.m Pacific. With one permanently remote team member, we were having to manually start a Google Hangout on the wallboard every morning. To make matters worse, our standup music was played by a small app which pulled the wallboard out of fullscreen mode. I took it upon myself to automate the wallboard and standup hangout completely within the browser, so in my spare time I wrote Crontabs.
Crontabs is a simple Chrome extension which allows you to open, show, reload or close tabs on a schedule defined by a cron expression. We’ve been using it for serval months now without a hitch. Here’s how to set it up.
The command below will open the Google Hangout from 10:30 and 10:37. Simultaneously at 10:30, our Hipchat bot, Marvin, will send a message to our Hipchat room with the static hangout link. These static URLs can be created with a recurring Google calendar event. For the cron experts out there, yes, I’m using seconds in the expression. The library which backs crontabs thankfully supports this.
To let people know that it’s standup time, it’s best to have some music to break them out their reverie. This expression opens a window to Pandora ten seconds before the hangout starts. The tab is closed forty seconds later, roughly coinciding with the start of the hangout.
Regular tab rotation
Running a regular tab rotation with a daily event is a little tricky as cron expressions let you specify different minute ranges for specific hours. The solution is to use two cron expressions: One for the hour the standup falls on, and one for every other hour.
Our Bamboo build status tab
[cc lang=’bash’ line_numbers=’false’]0 0-59/2 7-9,11-20 * * MON-FRI[/cc] Trigger on the first second of every other minute from 07:00 through to 09:59 and also from 11:00 to 20:59, Monday to Friday.
[cc lang=’bash’ line_numbers=’false’]0 0-29/2,37-59/2 10 * * MON-FRI[/cc]
Trigger on the first second of every other minute from 10:00 through to 10:29 and also from 10:37 to 10:59, Monday to Friday.
Real-time Google Analytics
[cc lang=’bash’ line_numbers=’false’]0 1-59/2 7-9,11-20 * * MON-FRI[/cc]
Show the tab on the first second of every other minute from 07:01 through to 09:59 and also from 11:01 to 20:59, Monday to Friday.
[cc lang=’bash’ line_numbers=’false’]0 1-29/2,38-59/2 10 * * MON-FRI[/cc]
Show the tab on the first second of every other minute from 10:00 through to 10:29 and also from 10:37 to 10:59, Monday to Friday.
Can you see a pattern arising?
Two tabs in rotation (minute expression)
Tab 1. 0-59/2
Tab 2. 1-59/2
Three tabs in rotation
Tab 1. 0-59/3
Tab 2. 1-59/3
Tab 3. 2-59/3
So now, using Crontabs, the standup starts and closes itself automatically and then goes back to its regular tab switching cadence. This is a technical success, I guess, but the real success is that the team takes it for granted. Crontabs is by no means finished. Future developments will allow controlling multiple browsers from a single crontabs instance and a setup tool to provide common solutions.
Crontabs is written in Angularjs and is powered by laterjs which provides both cron and textual expressions. It also supports seconds which are not typically supported in cron expressions.
You can find more technical details at http://crontabs.org
Crontabs is open source and hosted on bitbucket.