Skip to content

whirlxd/slack-music-status

Repository files navigation

slack-music-status

A userscript and server to update your Slack status with your current YouTube Music/Spotify/SoundCloud track.


an example status:

example eg2 eg3

How to use

  1. Clone this repo: git clone https://github.com/whirlxd/ytmusic-slack
  2. cd ytmusic-slack
  3. Install dependencies: npm install
  4. Create a .env file in the root directory with the following content:
SLACK_USER_TOKEN=xoxp-your-slack-user-token
PORT=8787
EMOJI=:youtube-music: (if your workspace has this emoji)
TEMPLATE=${title} :: ${artist} 
MIN_UPDATE_SECONDS=4
PRIVATE_KEY= a secret key for auth b/w script and server
EMOJI_YOUTUBE=:youtube-music:
EMOJI_SPOTIFY=:spotify_logo:
EMOJI_SOUNDCLOUD=:soundcloudnobg:
  1. Start the server: node server.js
  2. Install a userscript manager in your browser (e.g., Tampermonkey).
  3. Create a new userscript and copy the content of userscript.js into it.
  4. Adjust the SET constant in userscript.js to point to your server (e.g., http://localhost:8787/now-playing).
  5. Save the userscript and ensure it's enabled on music.youtube.com // open.spotify.com // soundcloud.com.
  6. Play some music on YouTube Music and watch your Slack status update!

Notes

  • If you are a teen you can host this - Nest. See this guide I have written.
  • Make sure your Slack workspace allows custom status updates via user tokens.
  • The userscript checks for the current track every 10 seconds by default. You can adjust this interval in the INTERVAL_MS constant in userscript.js.
  • The server clears your Slack status when no music is playing or when the track is paused.
  • Ensure that your browser and the server can communicate (eg. no firewall blocking, especially in Brave).
  • This project is for personal use and may violate YouTube Music's // Spotify's // SoundCloud's or Slack's terms of service. Use at your own risk. idrc
  • If need be there are some AI generated docs here - may contain errors.

License

GNU General Public License. See LICENSE file for details.

About

set current yt music , soundcloud , spotify song as slack status

Topics

Resources

License

Stars

Watchers

Forks

Contributors