One of the things that makes working at Pusher great is our appetite for building. We’ve created various internal tools, members of the team work on various open source projects — and of course, Pusher itself is designed to help others in this way. Alongside this, we also have regular HackDays, where we can take \[…\]
One of the things that makes working at Pusher great is our appetite for building. We’ve created various internal tools, members of the team work on various open source projects — and of course, Pusher itself is designed to help others in this way.
Alongside this, we also have regular HackDays, where we can take a break from our ongoing projects and stretch our legs a bit.
This time, I was part of a team to build a new ‘office DJ’ we could control from Slack.
Below the summary, generally in my own notes from the day, if you choose to replicate our system then we’d love to know how you get on.
We wanted to build a way for users to manage the songs played through our office speakers by typing commands into a Slack channel. This removes the need for the official Sonos client and let us query information about the song queue.
We also found it’s fun to see who is adding to particular tracks, and that leads to discussions about the songs interwoven with the commands that played them. Also users don’t get distracted by running another app to manage their music.
This is the general setup:
The example shows the flow for adding a new song. That is the most complex case. We also built-in support other commands:
\play
\pause
\volume-up
\volume-down
\remove
These work in much the same way, but without the additional step of querying the Spotify API for metadata.
And we also support queries:
\now-playing
\queue
Which allow us to get information about the currently playing song and the entire queue respectively.
Getting the command to the Sonos system works in much the same way, but the information is then propagated back to the Slack chatroom in the opposite direction.
The two separate components suited our team size of two!
Have you attempted any interesting integrations like this using Pusher? We’d love to hear from you.