Created
January 5, 2016 16:46
-
-
Save mbeasley/3fcb39fca5241b180aa8 to your computer and use it in GitHub Desktop.
Add the currently playing ncmpcpp mopidy-spotify song to a specific spotify playlist via bash script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Add the currently playing ncmpcpp mopidy-spotify song to a specific | |
| # playlist via bash script | |
| # | |
| # Dependencies | |
| # - ncmpcpp setup with mopidy and spotify (via mopidy-spotify) | |
| # - IFTTT account with the "Maker" channel activated | |
| # - An environment variable called MAKER_KEY containing your Maker | |
| # channel secret key | |
| # - An IFTTT recipe using a Maker trigger on the event "spotify-star" | |
| # that finds the song titled "value1" by artist "value2" and adds | |
| # it to the desired playlist | |
| # (https://ifttt.com/recipes/368566-save-ncmpcpp-now-playing-to-playlist) | |
| ARTIST=$(ncmpcpp --now-playing "%a") | |
| SONG=$(ncmpcpp --now-playing "%t") | |
| curl -H "Content-Type: application/json" -X POST -d "{\"value1\": \"$SONG\", \"value2\": \"$ARTIST\"}" "https://maker.ifttt.com/trigger/spotify-star/with/key/$MAKER_KEY" | |
| notify-send "Added '$SONG' by $ARTIST to Spotify favorites!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment