I’m using cmus for playing music. It can call a script whenever a song changes using the :set status-display-program=/path/to/scrobbler command.
I’ve written a PHP script bundle which handles scrobbling the currently playing and played song to last.fm. It can also read the ID3 (v1 and v2) tag from the music file using the getid3 PHP library.
You should set your last.fm user and password in the status_display_program.sh file and then set cmus to use that script as the status-display-program. I’ve placed the whole stuff under /home/nonoo/.cmus/last.fm.
You’ll need php5-cli and php5-curl installed.
Trackback URL
2 Comments »
Trackback responses to this post
About me
I'm Nonoo. This is my blog about music, sounds, filmmaking, amateur radio, computers, programming, electronics and other things I'm obsessed with.
... »
hey, i’m trying to get this working and running into some trouble. i don’t know if you still use this, but any help would be appreciated.
i got the script set up and put in my user/pw, and set the status_display_program to point to it. confirmed that it’s calling the script when song changes, and i’ve got php5/php5-cli/php5-curl installed.
any ideas?
just kidding, fixed it. for anyone else who reads this, it was a silly mistake — make sure the first line on addtolastfm.php is correctly pointing to your php install (#!/opt/local/bin/php)