Scribble
Simple Last.fm scrobbler for node.js
Scribble down the song
PreReqs
Get a last.fm API account and save the api key, api secret, and your username and password.
Install
npm install scribble
Use it
var scribble = require('scribble');// Build your scrobbler using your API keys and user infovar Scrobbler = new scribble('your_api_key','your_api_secret','your_lastfm_username','your_lastfm_password');// Make a song object in your appvar song = { artist: 'Slayer', track: 'Disciple', album: 'God Hates Us All' // Only needed for album info call}; /* POST methods All return the XML response from the POST requesta*/// Now PlayingScrobbler.NowPlaying(song, function(post_return_data) {});// ScrobbleScrobbler.Scrobble(song, function(post_return_data) {});// LoveScrobbler.Love(song, function(post_return_data) {}); /* GET methods All return the parsed JSON response from Last.fm*/// Get AlbumScrobbler.GetAlbum(song, function(ret) {});// Get Artist InfoScrobbler.GetArtistInfo(song.artist, function(ret) {});// Get Similar ArtistsScrobbler.GetSimilarArtists(song.artist, function(ret) {}, optional_return_amount_defaults_to_50);// Get Artist EventsScrobbler.GetArtistEvents(song.artist, function(ret) {}, optional_return_amount_defaults_to_50);// Get Artist Top AlbumsScrobbler.GetTopAlbums(song.artist, function(ret) {}, optional_return_amount_defaults_to_50);// Get Artist Top TracksScrobbler.GetArtistTopTracks(song.artist, function(ret) {}, optional_return_amount_defaults_to_50);// Get Similar SongsScrobbler.GetSimilarSongs(song, function(ret) {}, optional_return_amount_defaults_to_50);// Get Track InfoScrobbler.GetTrackInfo(song, function(ret) {});// Get Album InfoScrobbler.GetAlbumInfo(song, function(ret) {});
Tests
npm install
make test
or
npm test