spotify-activity-listener
1.1.2 • Public • Published Spotify Activity Listener
Poll Last.fm for your recent Spotify listening data.
Demo
Prerequisite Configuration
- Create a Last.fm account
- Enable API access for your account
- Make note of your API key
- In Spotify, go to
Settings > Last.fm
and select Connect to Last.fm
Installation
npm i spotify-activity-listener --save
Usage
import SpotifyListener from 'spotify-activity-listener';
var SpotifyListener = require('spotify-activity-listener');
- Instantiate the listener:
var Listener = new SpotifyListener({
username: 'YOUR_LAST.FM_USERNAME',
key: 'YOUR_LAST.FM_API_KEY',
pollInterval: 5000,
trackCount: 1,
callback: (res) => {
}
});
Listener.startListening();
- Stop listening (if need be)
Listener.stopListening();
Response Format
[
{
album: "Atrocity Exhibition",
art: "https://lastfm-img2.akamaized.net/i/u/300x300/514bed1643432ccf69854d30e35d24ba.png",
artist: "Danny Brown",
name: "Downward Spiral"
},
{ },
{ }
]
Contribute
- Fork it
- Create your branch
- Make some changes
- Commit the changes
- Submit a pull request
Package Sidebar
Install
npm i spotify-activity-listener
Weekly Downloads