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.

download (233.3 kb)

kevin 2013-12-26 05:46:55

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?

 
kevin 2013-12-26 06:00:02

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)

 
Name (required)
E-mail (required - never shown publicly)
Webpage URL
Comment:
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> in your comment.

Trackback responses to this post

About me

Nonoo
I'm Nonoo. This is my blog about music, sounds, filmmaking, amateur radio, computers, programming, electronics and other things I'm obsessed with. ... »

Twitter

Listening now

My favorite artists