Scrobble to with Pianobar

by Hunter Haugen

Pianobar is an excellent command-line Pandora client. It has support for calling external commands when songs play, pause, skip, et cetera via the event_command directive. With this, we can add a little scrobbling script and get our listening tracks sent to

First, cd to ~/.config/pianobar (or mkdir if it doesn’t exist) and paste in as, and chmod +x it. You’ll have to open and add your API key (get one from and username/password.

Next, go to pylast and get and put it in the same directoy as

Finally, open or create ~/.config/pianobar/config and put in these lines:

user =
password = somethinglong
event_command = /Users/username/.config/pianobar/

Bonus: If you’re a Pandora One subscriber, you can get the high-quality stream by adding the audio_format = mp3-hifi directive.

(Note: Due to shortcomings in pianobar, your password can’t have funny characters like & in it.)

When you start pianobar, it should start showing up on after the first song finishes. If there are problems then pianobar should print them to stderr.

Edit 2011-06-02: The gist has been updated to support Now Playing. Update your with the new version and pianobar should automatically start updating with Now Playing.