Skip to content

Instantly share code, notes, and snippets.

@synsa
Forked from jgamblin/slackspotify.sh
Created September 9, 2022 19:50
Show Gist options
  • Save synsa/017ade881a3a4fcf7aa0181196c6e281 to your computer and use it in GitHub Desktop.
Save synsa/017ade881a3a4fcf7aa0181196c6e281 to your computer and use it in GitHub Desktop.
A Script To Set Current Spotify Song As Slack Status
#!/bin/bash
APIKEY="From Here https://api.slack.com/custom-integrations/legacy-tokens"
SONG=$(osascript -e 'tell application "Spotify" to name of current track as string')
URLSONG=$(echo "$SONG" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"')
while true
do
curl -s -d "payload=$json" "https://slack.com/api/users.profile.set?token="$APIKEY"&profile=%7B%22status_text%22%3A%22"$URLSONG"%22%2C%22status_emoji%22%3A%22%3Amusical_note%3A%22%7D" > /dev/null
sleep 60
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment