Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var SpotifyWebApi = require('spotify-web-api-node');
- var scopes = ['user-read-private', 'user-read-email'],
- redirectUri = 'https://localhost:8888',
- clientId = 'f74fb79f4c824d839dd644805a09461d',
- state = 'some-state-of-my-choice';
- var spotifyApi = new SpotifyWebApi({
- clientId : 'f74fb79f4c824d839dd644805a09461d',
- clientSecret : 'xxxxx',
- redirectUri : 'https://localhost:888'
- });
- // Create the authorization URL
- var authorizeURL = spotifyApi.createAuthorizeURL(scopes, state);
- spotifyApi.setAccessToken(authorizeURL);
- spotifyApi.getFollowedArtists({ limit : 10 })
- .then(function(data) {
- // 'This user is following 1051 artists!'
- console.log('This user is following ', data.body.artists.total, ' artists!');
- }, function(err) {
- console.log('Something went wrong!', err);
- });
Add Comment
Please, Sign In to add comment