Created
April 4, 2014 18:32
-
-
Save kristianfreeman/9980555 to your computer and use it in GitHub Desktop.
example code to make all soundcloud playlists/tracks private
This file contains hidden or 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
client = Soundcloud.new(access_token: access_token) | |
#tracks | |
tracks = client.get '/me/tracks' | |
tracks.each do |track| | |
# obviously this logic is pretty simple, so it can be reversed easily | |
if track.sharing == "public" | |
client.put(track.uri, track: { | |
sharing: 'private' | |
}) | |
end | |
end | |
# playlists | |
playlists = client.get '/me/playlists' | |
playlists.each do |playlist| | |
client.put(playlist.uri, playlist: { | |
sharing: 'private' | |
}) | |
en |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment