Skip to content

Instantly share code, notes, and snippets.

@jammus
Created May 22, 2011 13:10
Show Gist options
  • Save jammus/985447 to your computer and use it in GitHub Desktop.
Save jammus/985447 to your computer and use it in GitHub Desktop.
Print user's last 10 played tracks. Print as user scrobbles.
var LastFmNode = require('lastfm').LastFmNode;
var lastfm = new LastFmNode({
api_key: 'apikey',
secret: 'secret'
});
var request = lastfm.request('user.getrecenttracks', {
user: 'username',
limit: 10,
handlers: {
success: function(data) {
// print tracks
}
}
});
var stream = lastfm.stream('username', {
autostart: true,
handlers: {
scrobbled: function(track) {
// print track
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment