Skip to content

Instantly share code, notes, and snippets.

@kristianfreeman
Created April 4, 2014 18:32
Show Gist options
  • Save kristianfreeman/9980555 to your computer and use it in GitHub Desktop.
Save kristianfreeman/9980555 to your computer and use it in GitHub Desktop.
example code to make all soundcloud playlists/tracks private
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