Created
September 13, 2014 22:45
-
-
Save martindale/e3a14d9cae46c364feb1 to your computer and use it in GitHub Desktop.
add all currently queued tracks to a specific playlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var username = 'martindale'; | |
var playlistID = '5414c5fadda8bb926e0017e4'; | |
$.getJSON('/playlist.json', function(tracks) { | |
tracks.map(function(x) { | |
return x._id; | |
}).forEach(function(trackID) { | |
$.post('/' + username + '/playlists/' + playlistID, { | |
trackID: trackID | |
}, function(res) { | |
console.log( trackID + ' added successfully'); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment