This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Code Sample
This is a simple example of how you can upload a track. It is done with the Ruby API wrapper but should hopefully be instructive even if you are coding in other languages.
require 'rubygems'
gem 'soundcloud-ruby-api-wrapper'
require 'soundcloud'
# This needs to be configured
settings = {
:site => "http://api.sandbox-soundcloud.com",
:consumer_key => 'c0n5um3r-k3y',
:consumer_secret => 'c0n5um3r-53cr37',
:access_token_key => '4cc35570k3n-k3y',
:access_token_secret => '4cc35570k3n-53cr37',
}
path_to_audio_file = "/absolute/path/to/audio_file.ext"
# Setup the connection to SoundCloud
consumer = Soundcloud.consumer(settings[:consumer_key], settings[:consumer_secret], settings[:site])
access_token = OAuth::AccessToken.new(consumer, settings[:access_token_key], settings[:access_token_secret])
soundcloud = Soundcloud.register({:access_token => access_token, :site => settings[:site]})
# This is where it begins:
me = soundcloud.User.find_me
puts "You are connected to SoundCloud as: '#{me.username}'"
track = soundcloud.Track.create(
:title => "This is a new track",
:asset_data => File.new(path_to_audio_file))
puts "New track '#{track.title}' is available at #{track.permalink_url}"






