Created
December 29, 2015 09:30
-
-
Save woto/ee173d60b9fbc730cd2d to your computer and use it in GitHub Desktop.
Sound Cloud Upwork Example
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
require 'soundcloud' | |
# create client object with app and user credentials | |
client = Soundcloud.new(:client_id => '9d4172e33cae2f8b20ef5603e494bc1d', | |
:client_secret => 'bee1d79bb85a00f4ccc2cefe1377d737', | |
:username => '[email protected]', | |
:password => 'Qwer3322!') | |
puts client | |
# upload an audio file | |
track = client.post('/tracks', :track => { | |
:title => 'This is my sound', | |
:asset_data => File.new('file.mp3', 'rb') | |
}) | |
# print track link | |
puts track.permalink_url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment