Tuesday, December 28, 2010

Pandora via Command Line

I came upon a rather interesting article pointing out a command line interface for the pandora.com radio service.  I believe on lifehacker, but it didn't quite work for me, so I thought I would throw together something to remind me, and to perhaps help out others, on how to do it later.

The program is called pianobar, and seems like a rather cool program. 

So, first thing you'll need is the compilers and make.  This is usually apart of Ubuntu, but incase it's not, try:

sudo apt-get install build-essential


And that should get the basic programs installed. 

Next, we need the libraries that piano bar depends upon.  To get these: 

sudo apt-get install libao-dev libfaad-dev libmad0-dev

Lastly, we'll need the program source itself.  To get this, I went to the git-hub, and downloaded the archive.  It has several versions of the pianobar, and in either .zip or tar.gz:

https://github.com/PromyLOPh/pianobar

So, then extract the archive, shell to that directory, and run "make".

You can either leave the pianobar executable that is made there, or do:

sudo cp pianobar /usr/local/sbin

To put it in a place where the shell can find it no matter where your current working directory is.

And then it's just a matter of running it, entering your pandora username and password, and rocking out.