Connect your Node.js app to Spotify via open.spotify.com
Just install the module and try it out with some exampels :) You need to have Spotify installed on the same computer where this script is running from.
$ npm install open-spotify-remote --save
var osr = require('open-spotify-remote');
var spotify = new osr();
spotify.connect();
spotify.on('connected', function() {
// Play one song over and over
//play(track)
spotify.play("1LVQ5LsVHxpgnY7VAyLjCR");
// Play a album
//playlist(user, playlist, track)
spotify.playlist("spotifydiscover", "67oFw1dAUZhGve2hPv5kgr", "7tJWarixh0rqI31ob9J7Kw");
});
spotify.on('error', function(error) {
console.log(error);
});
spotify.on('playing', function(play) {
console.log(play);
});
spotify.on('status', function(status) {
console.log(status);
});
setInterval(function () {
spotify.status();
}, 2000);
// Use this to pause or unpause
spotify.pause(true);
No test avalible. :(
- Auto connect to different port.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
- Krister Johansson - Initial work - fotoKrille
This project is licensed under the MIT License - see the LICENSE.md file for details