spotify-web-api-node
spotify-web-api-node copied to clipboard
Add getGeneric function; Add to tutorials
How do you feel about a function like this?
spotifyApi.getGeneric('https://api.spotify.com/v1/users/USERID/playlists?offset=20&limit=20')
It would make things like this possible (see tutorial folder for working example):
// Get first batch of playlists
const playlist = await spotifyApi.getUserPlaylists();
const allItems = [...playlist.body.items];
// Get further paging objects
let next = playlist.body.next;
while(next) {
const nextItems = await spotifyApi.getGeneric(next);
next = nextItems.body.next;
allItems.push(...nextItems.body.items);
}