Perl
Command-Line MPD Lyrics Fetcher
Fetching lyrics of songs played by MPD (Music Player Daemon). The script queries MPD for its current song (artist + title), if MPD is running the script is checking its cache in ~./lyricsCache.xml whether the current song has already been queried. If the cached song isn't the current song, the script uses the webservice getSong provided by lyricwiki.org to fetch the lyrics initially. After that the lyrics are written to the cache.
To-Do
Some error handling regarding non existing cache and not playing MPD.
Needed CPAN Modules
Install SOAP::Lite, Audio::MPD and XML::Path using: cpan -i SOAP::Lite Audio::MPD XML::XPath XML::XPath::XMLParser &&
Installation
tar xvf lyrics.tar.gz
sudo cp lyrics.pl /usr/bin/lyrics
sudo chmod +x /usr/bin/lyrics
Usage
Show lyrics of song currently played by MPD
lyrics
Get lyrics by artist and title
lyrics "Rainbow" "Long live Rock'N'Roll"