Skip to content

Instantly share code, notes, and snippets.

@ayasuda
Created February 25, 2015 07:03
Show Gist options
  • Save ayasuda/99adae00c7c6ab936e66 to your computer and use it in GitHub Desktop.
Save ayasuda/99adae00c7c6ab936e66 to your computer and use it in GitHub Desktop.
TOKEN="your token via https://api.slack.com/web"
CHANNEL="slack channel to post"
MUSIC=`osascript <<'END'
tell application "iTunes"
set trackName to name of current track
set trackArtist to artist of current track
return trackName & " / " & trackArtist
end tell
END
`
echo "I'm Playing $MUSIC" | slackcat -k $TOKEN -c $CHANNEL -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment