Slack is a new way to communicate with your team. It’s faster, better organized, and more secure than email. Download Slack for free for mobile devices and desktop. Keep up with the conversation with our apps for iOS, Android, Mac, Windows and Linux. In a matter of minutes and without a single line of code, Zapier allows you to automatically send info between Spotify and Slack. Get started with workflows like: Post new Spotify tracks in a playlist to a Slack channel. Or check out the rest of our guided workflows. Save time with Zapier; it's free to try. /spotify lets you control Spotify from within Slack, quickly view information about, and interact with, what you're listening to, and easily find and share music with the rest of your team. Please note that a Spotify Premium account is required to make use of some application features. /spotify /spotify lets you control Spotify from within Slack, quickly view information about, and interact with, what you're listening to, and easily find and share music with the rest of your team. Please note that a Spotify Premium account is required to make use of some application features.
How it all started
We’re using Slack extensively here at @Boldare, it seems that everyone does. Recently,I’ve noticed that if you paste a Spotify link to Slack, it gets converted to a Spotifywidget. What’s more, you can control your fully-local, desktop Spotify app from there!How come?! Let me show you the steps that I took in order to find the true answer.
Take the wrong path
A fellow suggested that the Spotify widget in Slack exploits the concept of customprotocol handlers (see here).
Let’s check it then! I’ve found an example of Spotify-protocol string (spotify://track:2wXBasaRrlX9gRTV5qPAbb),typed it into Firefox address bar and… it launched a second Spotify application.It didn’t connect with already running instance at all, just spawned a new one.
That’s not what I was looking for!
Find the widget
Another fellow suggested that it might be useful to play around with Spotify’s play button,which could potentially work similarly as Slack’s widget (they indeed look similar).
I’ve found a demo button hereand verified that it is also able to control the running desktop application! Hey,we’re in a normal browser here, so let’s launch developer tools!
After you play Carly Rae Jepsen’s Run Away With Me, you can notice a couple of entriesin the network log! Hooray!
What’s the 127.0.0.1:4381
host? Let’s take a closer look at one of the requests :)
As you may have noticed, this request is received by the local Spotify webserver.More precisely:
- the app exposes HTTP port 4381,
- request path is
/play.json
, - request parameters contain data about the song/album to be launched and someadditional security-related parameters (CSRF, oauth).
Slack Spotify Bot
We found it!
More info to extract
If you were curious about the data the app returns to the widget, take a look atthis JSON snippet.
There’s a multitude of interesting data, such as the track we’ve been currently listening,volume set, some player settings and the version of the application.
I hope you liked this quick investigation!
Once you have integrated both your Spotify and Slack accounts with Jukebot, you are ready to start collaborating on your playlist.
Jukebot uses the slash commands you are already familiar with. Find all the commands below. Learn them. Cherish then.
Slack Spotify Player
What are you waiting for? 🎶
How To Play Spotify On Computer
Command | Description |
---|---|
/add track name | Add a song to your Jukebot playlist |
/album album name | Search for an album |
/artist artist name | Search for an artist |
/current playlist|track | Get the name of the Jukebot playlist |
/delete | Delete the currently playing track from your Jukebot playlist |
/find track name | Search for a track to add to your Jukebot playlist |
/jukebot on|off | Leaving the office and don't want your team controlling your Spotify player? Turn Jukebot off when you leave and on when you return! |
/pause | Pause Jukebot * |
/play track name (optional) | Start playing your Jukebot playlist. Want to play a specific song? Add it to the command. * |
/repeat | Play your Jukebot playlist on repeat |
/reset | Make your Jukebot playlist a clean slate |
/shuffle | Shuffle the tracks in your Jukebot playlist * |
/skip | Skip the currently playing Jukebot track * |
/surprise | Add a surprise track to your Jukebot playlist |
/volume 0-100 | Change the Jukebot volume * |
/whom | Who was the last person to request the currently playing track |
* Spotify Premium users only