This node module is a wrapper for interacting with the system installed pianobar client.
npm install --save aeewhite/node-pandora
var pandora = require('node-pandora');
pandora.start([commandlocation]);
Starts the installed pianobar client. Will default to /usr/local/bin/pianobar
.
pandora.playpause();
Toggles between playing and paused
pandora.next();
Skips to the next song
pandora.quit();
Stops the pianobar process
pandora.bookmark();
Bookmark the current song
pandora.love();
Love the currently playing song
pandora.ban();
Ban the currently playing song, can only be removed using the Pandora web interface
pandora.songTired();
Ban the current song for one month
pandora.volumeDown();
Lower pianobar volume
pandora.volumeDown();
Raise pianobar volume
pandora.setStation(stationIndex);
Change station to the station at stationIndex (refer to the list provided by getStatus()
)
pandora.deleteStation();
Delete the currently playing station
pandora.getStatus();
Returns an object of the most recent pianobar event with the following structure
{
event: '',
artist: '',
title: '',
album: '',
coverArt: '',
stationName: '',
songDuration: 0,
detailURL: '',
stationCount: 0,
stations: {
'index':'stationName'
}
}
event
is the name of the most recent pianobar eventartist
is the artist of the current songtitle
is the title of the current songalbum
is the album the current song is oncoverArt
is a url to the cover art on Pandora's serversstationName
is the name of the currently playing stationsongDuration
is the length of the current song in secondsdetailURL
is a url to details page for the song on the Pandora web sitestationCount
is the total number of user stationsstations
is an object with keys for each of the users stations. The key is the station number (index) and the value is the name of the station.
The values for artist, title, album, and station names are escaped
node-pandora provides an event emitter to listen to all events from pianobar. Events include songstart
, songfinish
, etc (full list can be found in man pages for pianobar). The status object provided by the event will be provided along with the event.
pandora.events.on('songstart',function(status){
//Handle Event Here
});
##Note
Remember to quit the pianobar process before exitting with pandora.quit();