Usage:
1. Install library
bower install jquery-spotify-add-playlist
2. Create a Spotify Application: https://developer.spotify.com/
3. Add a redirect URI to your Spotify app that is [yoururl.com]/spotify-callback
4. Include plugin after jQuery
5. Invoke the plugin:
// Click function just used as an example
$('button').click(function(e) {
// Set Track ID
var track = $(this).data('track');
$(this).spotify_add_to_playlist({
// Playlist Name - can be whatever you like
playlist_name:'My Funky Playlist',
// Client ID from your Spotify application in step 2
client_id:'',
// Track Spotify ID
track: track
});
e.preventDefault();
});
Details:
This plugin uses the javascript Spotify Web API and requires javascript in order to function. Read more about the Spotify Web API here: https://developer.spotify.com/web-api/
Credits:
This plugin based on development done for Essential Worship at Centresource. It was also inspired heavily by the good work of https://github.com/possan/playlistcreator-example