Provides an EventEmitter interface pulling Last.fm scrobble history
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.jshintrc
.travis.yml
Gruntfile.js
README.md
index.js
package.json
test.js

README.md

lastfm-history Build Status

Provides an EventEmitter interface to gaining Last.fm scrobble history.

Installation

$ npm install lastfm-history

Example

var getHistory = require('lastfm-history');

var user = 'bencevans';
var apiKey = process.env.API_KEY;

var worker = getHistory(user, apiKey);

worker.on('page', function(tracks, meta) {
  console.log(tracks.length + ' scrobbles just pulled');
  console.log('meta:', meta);
  // store into database or file etc.
});

worker.on('complete', function() {
  console.log('complete');
  // start processing knowing you've got the whole dataset
});

worker.on('error', function(err) {
  console.log('err:', err);
});

Licence

MIT © Ben Evans