Integrating AudioBoo and Phreadz with Dabr
A quick explanation of how I integrated AudioBoo and Phreadz with Dabr.
I'm a big fan of AudioBoo - for those who don't know it, AudioBoo allows you to record some audio on your phone and then publish it to the web. It's like instant podcasting. Originally only for the iPhone, AudioBoo now works on Android and there's an S60 version comeing out "soon".
I'm very proud to announce that as of r260 - Dabr now support AudioBoo!
It all started with a tweet from David Carrington (creator of Dabr) asking how one would go about linking directly to a tweeted 'boo.
So - how do I turn a tweeted 'boo like http://boo.fm/b73803
to the associated MP3 of http://audioboo.fm/boos/73803-rockbandboo.mp3
?
Bring Me The API!
An API is a way for two computers to talk to each other. The client (dabr) asks the server (AudioBoo) a question. The server replies with some data and the client then does something with it.
AudioBoo's API is a "work in progress" - that's the polite term for "not quite finished". There are various APIs to get information about a 'boo. However, it's not particularly intuitive. For example, if I use /audio_clips/ http://api.audioboo.fm/audio_clips/b73803.mp3
I get an error. I have to drop the b to get http://api.audioboo.fm/audio_clips/73803.mp3
I asked on the AudioBoo forums if there was a better way but I didn't get a quick response - so I turned to twitter. One of the top AudioBoo bods, Mark Rock, is an active twitterer (seriously - isn't there a better word than that?)
So, now I can link http://boo.fm/b73803
to http://boo.fm/b73803.mp3
- simple. Here's what it looks like in the browser.
Phreadz
Phreadz is a service which allows you to post VITAL - Video Images Text Audio Links - it's a fantastic service, so when Kosso (its founder) asked me to integrate it into Dabr, I was keen to take on the challenge.
The code was quite simple and can be seen in r261. But there was one small complication - image sizes.
The thumbnail images from Phreadz aren't always suitable for mobiles. If images are too large, it will slow download speeds and potentially cost people money.
So, I used tinysrc.mobi. Tinysrc is a very simple API which will resize any image to a mobile friendly format. It detects the phone's user-agent string and creates a suitable sized image.
Here's what it looks like.
Conclusions
I've used 4 separate APIs here - twitter, AudioBoo, Phreadz, tinysrc - the joy of Web 2.0 is that all those disparate services can combine to create something new and magical.
API designers often need to think about how their products will be used "in the wild". It's very easy to create something that works very well for your requirements - but much harder to think about what others will need.
Kosso says:
Very cool! Nice one Terence! 😉
PHANX!