Skip to content
Node library to control pianod (pandora daemon) http://deviousfish.com/pianod/
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
.gitignore
README.md
package.json

README.md

pianod

Pianod is wrapper library for talking with pianod server: http://deviousfish.com/pianod/index.html

Requirements

Installation

npm install pianod

Usage

pianod.connect()

Examples

var pianod = require('pianod')();

pianod.connect({host: 'localhost', port: 4445});
pianod.user('admin', 'adminpassword').then(function(response) {
  if (!response.error) {
    console.log('Logged in.');
  }
  else {
    console.error('Not good, probably wrong username/password');
  }
});

pianod.status().then(function(response) {
  if (!response.error) {
    console.log(response.songInfo);
  }
  else {
    //handle error
  }
});

//more exampled without error handling etc

pianod.pause().then(function(response){});
pianod.play().then(function(response){});
pianod.stop(true/* true if stop now, false if end of track (default) */).then(function(response){  });

Use as an EventEmitter

pianod.on('songStart', function(songInfo) {
  console.log('Song started, info about song:', songInfo);
});

pianod.on('playbackPause', function(songInfo) {
  console.log('Song paused, info about song:', songInfo);
});

pianod.on('playbackResume', function(songInfo) {
  console.log('Song playback resumed, info about song:', songInfo);
});

pianod.on('songComplete', function(songInfo) {
  console.log('End of song (track complete), info about song which just played:', songInfo);
});
Something went wrong with that request. Please try again.