talking about code
I’ve been working on a Ruby on Rails / SoundCloud / Heroku web app, for my SENG 435 course at UVic, and I’ve hit some snags that I want to document, in case anyone ever hits the same thing.
– I’m working in Ubuntu 10.10. SoundCloud & Flash in Ubuntu is a tough thing at the moment. Parker & Omid have answers.
– I’m recording audio using the SoundCloud JavaScript SDK. I needed to permanently authorize a single SoundCloud account for all users to post audio to. That’s possible by passing an OAuth Access token to Recorder.upload:
Recorder.upload({url:”https://api.soundcloud.com/tracks.json?oauth_token=” + YOUR_ACCESS_TOKEN, …
I ended up hard-coding mine into the javascript file, because I am a terrible person. There might be a real way to do this, but I can’t find it in the docs.
– I’m using Heroku, who are mostly wonderful. I had to use the RAILS_ENV=production bundle exec rake assets:precompile command, as detailed here.
– I’m also using SoundCloud oEmbed endpoint, and I could not, for the life of me, get a response back when calling it from Heroku…until Johannes Wagenger at SoundCloud pointed me to the following:
Net::HTTP.get(URI.parse(“http://soundcloud.com/oembedformat=json&url=YOUR_URL”))
No idea why the code I was using that did almost the same thing didn’t work, but it works now.