DEV Community

loading...
Cover image for Share your music in Slack!

Share your music in Slack!

Aeden Murray
Building cool stuff. Hacking the planet. Saving the turtles.
・1 min read

Hello DEV! Today I'm here to show off a fun project that allows you to share whatever music you're currently listening to as a status in Slack.

* Supports both Apple Music & Spotify

This will set your status emoji to a 🎵 (:musical_note:) and your status text to {Track_Name} by {Artist}.

Usage

Your musical status will automatically be set as long as:

  1. You have Slack open
  2. You are playing a song on Apple Music or Spotify
  3. Your Slack status is empty OR your status emoji is the 🎵 (:musical_note:)

Installation

$ brew tap aedenmurray/tap
$ brew install listeningto
Enter fullscreen mode Exit fullscreen mode

Configuration

To use the Slack API you will need a legacy token. Legacy tokens were deprecated in March of 2020. However, you can still retrieve a legacy token through some quick reverse engineering:

  1. Go to https://my.slack.com/customize. (You must be logged in)
  2. Right-click anywhere and open up the developer console.
  3. In the JavaScript console run this code snippet:
window.prompt("API Token: ", TS.boot_data.api_token)
Enter fullscreen mode Exit fullscreen mode
  1. Once you have your API token, create a new file in your home directory:
$ nano ~/.slack_token
Enter fullscreen mode Exit fullscreen mode
  1. Paste your Slack API Token in the file. Save (^+O return) and exit (^+X)

Footnotes

Your Slack status should update about every 10 seconds.
The Homebrew Formula is defined here.

https://github.com/aedenmurray/listeningto

Discussion (1)

Collapse
tiger_ali_9b345a7225c8465 profile image
Tiger Ali

Hi! Does this still work? Install went smoothly, but not getting updates in slack (latest slack/big sur).