Skip to content

Instantly share code, notes, and snippets.

@bufordtaylor
Created January 31, 2015 02:25
Show Gist options
  • Save bufordtaylor/2f7b46e6caac24fdcbf7 to your computer and use it in GitHub Desktop.
Save bufordtaylor/2f7b46e6caac24fdcbf7 to your computer and use it in GitHub Desktop.
# in gemfile
gem 'soundcloud'
#don't forget to bundle install
# in haml
= @embed_info['html'].html_safe if @embed_info
# in controller
client = SoundCloud.new(:client_id => "[your_soundcloud_id]")
track_url = @user.soundcloud # any soundcloud url ex http://soundcloud.com/tripp-karrh-audio/fantasy
@embed_info = client.get('/oembed', :url => track_url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment