cplay Scrobbler Plugin

09 Jan 2010

Since the earliest of my linux days, I've always loved console applications. Some of them were (some still are) the state of the art in their category, sometimes exceeding the desktop apps in features and configurability. Above all they are small, fast and elegant. Among these, emacs, mc, mutt, irssi, rtorrent and cplay are prime examples of excellent software.

The latter is a tiny music player [1]. A single file of 1600 lines of python code creates a wonderfully simple UI, folder navigation and bookmarking, playlists, emacs and vi keybindings.

What more can one want? I'll tell you what: song queues in the playlist and last.fm support. Luckily the player looks for a .cplayrc file in your home directory and executes it as python code if it's there. Perfect for hacking together a little plugin to solve the latter of my feature requests.


The code is hosted in this github repository: http://github.com/grimdonkey/cplay_scrobbler. The content of the python file has to be pasted in your .cplayrc file, and modified to contain your username and password. You also have to install the scrobbler python package (using easy_install scrobbler), and you're ready to go!


Some known issues:

These limitations will hopefully be corrected in the future :)

  1. ^ It uses mpg123 / ogg123 to play the music files, so you need those packages installed.