2013-01-10 10:57:25 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2014-04-30 09:06:35 +00:00
|
|
|
# Returns the lyrics of the current track playing in Spotify.
|
2013-01-10 10:57:25 +00:00
|
|
|
#
|
|
|
|
# A fine piece of work by @febuiles
|
|
|
|
# https://gist.github.com/1549979
|
|
|
|
|
2014-04-30 09:06:35 +00:00
|
|
|
artist=`osascript -e'tell application "Spotify"' -e'get artist of current track' -e'end tell'`
|
|
|
|
title=`osascript -e'tell application "Spotify"' -e'get name of current track' -e'end tell'`
|
2013-01-10 10:57:25 +00:00
|
|
|
|
|
|
|
song=`curl -G --data-urlencode "artist=$artist" \
|
|
|
|
--data-urlencode "title=$title" -s http://makeitpersonal.co/lyrics`
|
|
|
|
|
2014-04-30 09:06:35 +00:00
|
|
|
echo -e "$artist - $title\n$song"
|