Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Tweet now-playing song and artist #351

Closed
smartwatermelon opened this Issue · 3 comments

2 participants

@smartwatermelon

This eventcmd script uses sferik's T command-line Twitter client to tweet the now-playing song and artist. I've set it to use the songbookmark trigger, but of course you can use a different one.

#!/bin/bash

# create variables
while read L; do
    k="`echo "$L" | cut -d '=' -f 1`"
    v="`echo "$L" | cut -d '=' -f 2`"
    export "$k=$v"
done < <(grep -e '^\(title\|artist\|album\|stationName\|songStationName\|pRet\|pRetStr\|wRet\|wRetStr\|songDuration\|songPlayed\|rating\|coverArt\|stationCount\|station[0-9]*\)=' /dev/stdin) # don't overwrite $1...

case "$1" in 
    songbookmark)       
        echo '#NowPlaying: '$title' - '$artist' (via #pianobar)' | xargs -0 t update
        ;;
esac

Result:

 |>  "I Want You To" by "Jem" on "Down To Earth"
 [?] Bookmark [s]ong or [a]rtist? s
 (i) Bookmarking song... Ok.
 Tweet posted by @smartwatermelon.

 Run `t delete status 302505518990229504` to delete.
@PromyLOPh
Owner

I guess this would be something for the wiki (which does not exist yet).

@smartwatermelon

I was hoping it could be added to the eventcmd samples.

@PromyLOPh
Owner
@PromyLOPh PromyLOPh closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.