Skip to content
This repository has been archived by the owner on Nov 21, 2018. It is now read-only.

Latest commit

 

History

History
39 lines (25 loc) · 882 Bytes

README.md

File metadata and controls

39 lines (25 loc) · 882 Bytes

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