Under the hood of Radio Pop
Yesterday, Tristan introduced Radio Pop, our social radio listening prototype. For those of you who would like to know a bit more about its architecture, how it works and how you can use your data, this post is for you.
Radio Pop is a Ruby on Rails application. Why? Because that's where the R&D team's experience lies. Rails might not be the first choice for a real-time web application meant to support a large number of users, but I'm not about to get anywhere near the debate as to what should be. In order to give our application a fighting chance of serving a (potentially) large number of concurrent listeners, it runs on the super-lightweight and super-fast web server nginx. The availability of each Mongrel instance is further enhanced using the fair proxy-balancer module. And of course we are using Memcached to avoid hitting the database where possible.
Listening and popping
Radio Pop tracks what you listen to through an HTTP POST 'pulse event' sent by the client radio player (either on the Radio Pop site, a desktop widget or other) every 60 seconds. This pulse simply tells Radio Pop who you are and what network you are currently listening to. Radio Pop then retrieves the programme, series and brand information for that network - all of which comes from /programmes - and stores it. When you start listening to a different network or listen over a programme boundary, these pulse events are combined into a single 'listen event' for that programme. When you stop listening, a sweeper processes your recent listening after about 5 minutes of inactivity. Pop events work in the same way as pulse events.
This process works for both live and on-demand listening, but we are yet to implement an on-demand Radio Pop player. (And if RealPlayer is not your favourite audio player, we are looking at building a player which utilises other technologies.)
Open standards and data portability
We have attempted to support open standards which are applicable to a social listening application. We've tried to make the barrier to entry as low as possible and ask for as little information about you as we can so you can sign up using your OpenID alongside standard username and password entry. You can actually link a number of OpenIDs to your account should you wish and remove them at any time - its pretty flexible.
Radio Pop supports OAuth authentication for client applications which need to be able to update your listening profile, so you don't have to enter your username and password into third-party applications (should there ever be any). This is also how the desktop widget works.
We are currently not doing a great deal with your listening and popping data. We have plans to introduce recommendations and personalisation but that is some way off. In the mean time I recommend you have a look at the feeds and formats in which you can get your data (and your friends' data and everyone's data). Here's just a selection:
- My profile, including what I'm listening to:
- My friends list:
- My recent listening RSS feed:
- My Radio 1 listening history:
- My recent friends' pops RSS feed:
- My pops history:
You can also get your listening habits in APML (an open format for attention data), here's mine:
As a starter, I built the Radio Pop blog badge below using user profile XML data. Check out the full API docs for more information and if you build an interesting visualisation or mashup please let us know.