Festival Radio 2011

Much like last year, I thought it’d be useful to write up a few quick thoughts about Festival Radio – which took place at this year’s Radio Festival up in Salford.

This year, we took on a slightly different incarnation. Instead of being live on various local DAB multiplexes and running it out of the old Xfm live room at Global’s Manchester studios, we were given a decent bit of space inside the Lowry itself to use as a base. Being in the same building as all the action was fantastic – it allowed us to be really flexible in what we covered, and meant we could turn things around a lot more quickly than we did last time.

Whilst this year might have seemed less ‘radio’ than last year, podcasts are much more suitable for the occasion. The main aim was to bring the Festival to those who were unable to make it, but there’s no denying that the delegates form a fairly large chunk of our audience. Last year, it was fairly impossible for delegates to tune in as our hours matched those of the Festival. Having it on demand is a massive improvement.

We’ve had some really good feedback from various people on Twitter, as well as a nice thank you from John Myers. As a team, it meant a lot to us to hear good things from respected people in the industry – so thanks, if you took the time to let us know you enjoyed it. I think the most interesting bit is listening to how they progressively improve.

Hopefully it’ll be back again next year, and no doubt it’ll be even better. If you didn’t catch them, you can listen to the podcasts on the Radio Academy website, or subscribe using iTunes.


Big thanks to Kate Cocker and Heather Davies for organising the whole thing, everyone at the Radio Academy for their help in making it happen, and to James Stodd and Dan Snaith at BBC Radio XTrails for the production.

Google Analytics and “Like” Buttons

This is a quick post to show you how to track user interactions with “social” buttons inside Google Analytics.

Luckily, the three main social interaction buttons that you see around the web (Facebook’s ‘Like’, Twitter’s ‘Tweet, and Google’s ‘+1’), all have ways of letting you perform an action when they’re clicked.

To do so, you just need to add some Javascript into your page along these lines:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<script type="text/javascript">
  /* Facebook */
  FB.Event.subscribe('edge.create', function(href, widget) {
    _gaq.push(['_trackEvent', 'Social Media', 'Facebook', href]);
  });
  /* Twitter */
  twttr.events.bind('tweet', function(event) {
    _gaq.push(['_trackEvent', 'Social Media', 'Twitter', document.URL]);
  });
  /* Google */
  function plusone_vote(obj) {
    _gaq.push(['_trackEvent', 'Social Media', 'Google', document.URL]);
  }
</script>

That code assumes that you’ve got _gaq available as a variable – that is, this Javascript should come after your the Google Analytics tracking snippet.

I’ve assumed you’ve already got FB and twttr available as objects, which will be true if you’ve got Facebook and Twitter buttons loaded in the usual way.

Running a Blog on Jekyll

Don’t get me wrong, I love Wordpress. It’s ridiculously flexible, there are a huge number of plugins and themes available, and it has an extremely active community surrounding it.

However, for my blog (which is just a bunch of posts and not a huge amount else) I feel like it’s overkill. I don’t really need a database, or plugins, or comments, or any of that cruft. I just need a very simple set of pages.

Enter Jekyll – a Ruby-based static site generator that takes a directory of layouts, a directory of posts, and applies a bit of cleverness to combine the two and spit out a directory of flat HTML files. Posts are written in Textile (Markdown is also supported) with a single file used for each post.

The advantages? No databases to worry about, and no pre-processing. Just static files being spit out to users by nginx. No hanging around for the database to be queried and for PHP to process that into a page. The whole thing lives in a repository on Github, if you want to see how it all hangs together. I’ve yet to set it up so that the site gets re-deployed when I commit, but that’s next.

Plus, there’s a nice non-technical bonus to the whole thing: you write all your posts in a text editor. I like that, it takes away all the fancy widgets and buttons that you get in WYSIWYG editors and lets you focus on what you’re actually writing.

If that sounds interesting but you’re not quite sure where to start then let me know, I’d be glad to help.

Facebook Connect and Python

This afternoon I’ve been wrestling with Facebook Connect for a project I’m working on. Chances are that you’ve come across it before. It’s a button on third-party sites that says something along the lines of “Login Using Facebook”, allowing you to identify yourself to them using an account you already have.

Think what you like about Facebook as a company, but I think the tools they release to developers (particularly the Login Button and Comments) are great. They lower the friction of an action by making it as easy as possible: in this case, adding a comment or becoming a member of a site. Not only do they make this easy, but things like Comments provide a familiar interface to users that encourage them to engage – and it’s becoming increasingly popular.

I could ramble on for ages, but this post is a technical one.

The downside of Facebook is that it’s massive. And it’s popular. And they keep changing their APIs and the way things hang together. The result is a large number of libraries and tutorials that are either irrelevant or out-of-date. I prefer to know how something hangs together technically, and then make it work in whatever I’m coding. So here’s how it works.

Set Up a Facebook App

First thing’s first – you’ll need to set up an app through the Facebook Developers site, which will give you an application ID and secret that you’ll need to use in order to be able to ‘talk’ to Facebook.

Putting a Login Button on Your Site

Next, you’ll need to put some Facebook Javascript onto your site:

1
2
3
4
5
6
7
8
9
10
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
    FB.init({
        appId: 'YOUR_APP_ID',
        cookie: true,
        status: true,
        xfbml: true
    });
</script>

With that done, you’ll be able to use FBML to add a login button:

1
<fb:login-button>Log in using Facebook</fb:login-button>

Talking to Facebook

Once you’ve got that done, you’ll be able to visit that page and click the “Login” button. That’ll take the user through the steps they need to grant permission to your application to use their data. It pops up as a new window, which closes once the process is over.

Fetching Data

Once the user has granted permission, you’re all ready to talk to Facebook to get data about that user.

In this example, we’re using a method which is used as a Django view. But whatever Python web framework you’re using, it’s going to be similar. The key thing is that get_user_from_cookie searches through an array of cookies looking for the Facebook authorisation token.

Here, we’re using Facebook’s own Python SDK – it’s ace. Below, The token is used to create a new instance of the Graph API, and then we just query it for that user’s details. The bit at the end is somewhat Django-specific, but we’re just passing that array of profile data to the template.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from django.views.generic.simple import direct_to_template
import facebook

def user_home(request):
    extra_context = {}
    user = facebook.get_user_from_cookie(request.COOKIES,\
        app_id, secret)
    if user:
        graph = facebook.GraphAPI(user["access_token"])
        extra_context['profile'] = graph.get_object("me")
    return direct_to_template(
        request,
        'template.html',
        extra_context
    )

Finished

There, you’re done. You’ve got a user to grant you permission over some of their data, and you’ve managed to fetch their data in your Python application. What you do with it now is up to you – this isn’t meant to be a massively in depth tutorial, but more of a guide to get you up and running.

RadioVIS Slides With HTML

This is a bit of an introduction to what I made at the RadioDNS Hackday in Geneva on 15th February. If you just want the code, you can skip to the end!

Once you’re all set up with your infrastructure to serve RadioVIS, what you’re essentially left with is a nice blank canvas to fill with content — but it’d be a bit boring to just fill it with static images. What you really want to do is create some dynamic slides that pull through information (like now playing data) from various places and put that together in a way that looks decent.

To do this you need to use some kind of imaging library like GD or PIL, which in layman’s terms lets you write a set of instructions to construct an image. However, there’s a couple of problems with most of these libraries. Firstly, the instructions for putting together these images can be a bit fiddly — it’s all absolute co-ordinates, and you have to write your own clever methods to do things like text wrapping. Secondly, the font rendering is a bit rubbish with lots of jagged edges and some odd transparency.

Before the RadioDNS Hackday in Geneva last week, I had a cunning idea. Web browsers (and especially Safari) do a great job of rendering fonts, and we can do lots of CSS3 wildness like 3D transforms and drop shadows. Plus, HTML and CSS are a bit more accessible for Joe Public to understand and create. So why not code up our slides in HTML, and then transform that into an image?

Here’s an example of the kind of image the program makes:

Because the program uses WebKit, we’re taking full advantage of lots of nice CSS3 bits like gradients, rotation, box-shadow and @font-face.

I’ve popped the code that does this up on Github — it’s a bit messy at the moment, and you’ll need a few things like pyobjc. I’m pretty sure this will only work on a Mac, unfortunately, but the project is still young. There’s a few examples of templates in there to give you an idea of how it works. Comments, bug reports and forks are all welcome!

Get the source from Github.

Links for 13th February 2011

  • Customizing the Django Admin
    Django’s ‘automatic’ admin interface is good but it falls down in places – namely, lack of customisation and the bits that appear in things like the WordPress Dashboard. This presentation from Linked Loop outlines some ways to start solving these problems.

Interview With Andy Parfitt

Whilst I was working on Radio Festival Radio this year, I got a chance to interview Andy Parfitt – the controller of Radio 1 and 1Xtra, amongst other job titles. I managed to grab a quick interview with him, without making myself seem like too much of an idiot. Only part of it made it to air, so I thought I’d post up the whole thing here.

He talks a bit about what he enjoyed at the first day of this year’s Radio Festival, and his thoughts on the increase of visualisation at Radio 1.

Get the MP3 here.

Installing MySQL on an EC2 Micro Instance

I’ve been doing a fair bit of work with Amazon EC2 instances recently, for my Final Year Project at uni. If you’ve not come across them before, then it’s basically Amazon’s way of making web-scale computing easy to set up and access. And it’s even more interesting when you see that they’re bringing in a free usage tier for the Linux Micro instances from 1st November this year.

When you create a new instance, you can choose an OS. If you choose “Basic Amazon Linux” (like I did) then you’ll get a stripped-down version that doesn’t have some bits you might be used to (like apt-get). I had to install MySQL recently, so here’s how to do that on such a setup:

1
2
3
4
5
6
sudo yum install mysql
sudo yum install mysql-server
sudo yum install mysql-devel
sudo chgrp -R mysql /var/lib/mysql
chmod -R 770 /var/lib/mysql
sudo service mysqld start

By this stage, you’ll have MySQL installed and the service started. The next step is to set a password for the root user:

1
/usr/bin/mysqladmin -u root password yourpasswordhere

If you only want to use MySQL internally, then you’re all done now. But if you want to access MySQL externally then you’ll need to follow a few extra steps.

Firstly, go to the AWS Management Console, and find the Security Group that you assigned to your instance when you first set it up. Add “MySQL” to the group using the dropdown, or manually add port 3306. Save your changes.

Finally, create a MySQL user which is able to connect from any host (identified by a percent sign below) by running the following SQL using mysql from your instance’s command line:

1
2
3
4
5
6
7
mysql> CREATE USER 'myuser'@'localhost' IDENTIFIED BY 
    -> 'yourpasswordhere';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'localhost'
    -> WITH GRANT OPTION;
mysql> CREATE USER 'myuser'@'%' IDENTIFIED BY 'yourpasswordhere';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%'
    -> WITH GRANT OPTION;

And then you’re done, ready to connect from anywhere with that username and password.

Radio Festival Radio Roundup… Radio

So I’m fresh back from working as a producer/technician/jack-of-all-trades at Radio Festival Radio, a pop-up station that ran for three days to cover this year’s Radio Festival in Salford. Apologies in advance that I’m sort of stealing the format of this blogpost from fellow RFR man Matt Harrison. So what did I learn?

It’s a friendly industry.
This wasn’t completely new to me, but the whole project was built upon favours and the goodwill of others – right through from the presenters to the studio space and the streaming. Big thanks to Colin, Mike and the team at Global Manchester for letting us use the studio, office and kettle. I’m pretty sure we may have made Clint Boon late at one stage as well. Oops.

The Lowry is a fantastic venue.
But, Salford Quays and MediaCityUK still seem a bit odd to me – I think it’s because the whole place has shot up over the past few years and it doesn’t feel very “bedded in” yet. Don’t get me wrong, it’s a brilliant place, it just feels somewhat uninhabited at the moment. I challenge you to find a decent pub within walking distance of The Lowry, and before you say Lime Bar, that definitely doesn’t count.

“Celebrities” are more approachable than you think.
I managed to pluck up the courage to ask Andy Parfitt a quick question, and the rest of the team managed to get Richard Bacon to come and do an interview with us live on air. It echoes what I saw at Folder Media – nearly everyone is happy to help out where they can, even if that’s just a friendly chat. Even Ashley Tabor took time to pop his head around the door when he was touring around Global Manchester.

Doing a live radio show is scary, but a massive amount of fun.
Our team produced a huge amount of fantastic content, but the running order of our live shows evolved as they happened. As a result, we were left with some great stuff that we just didn’t have the time to use. I have absolutely no experience of how time-sensitive live shows like that work in the “real world”, but it made me wonder how much content gets produced elsewhere without ever seeing the light of day. I’d be interested to hear comments on that one.

Scheduling music radio is tricky.
I have no idea how the music bosses of stations manage to separate what they want to hear, and what their listeners want to hear. Me and Kieran (the station manager) had lots of fun mashing the ‘K’ button in Selector and telling it to play something else. Craig David anyone? No?

No song should begin like Diana Vickers’ “Once”.
It makes everyone in the studio panic.

We also played host to the first ever live edition of RadioTalk, which is available in podcast form. If you’re even mildly interested in radio, then you should subscribe. It’s good. But then I’m biased, because I helped to record the latest one…

Whilst I only made it to one of the sessions across the whole festival (Evans and Mallett, a good choice), I had a fantastic time and worked with a team of absolutely brilliant people. If you listened, then I hope we managed to bring you a taste of what was going on at the Radio Festival. And if you didn’t get a chance to tune in, we’ll try and get some highlights online soon.

Same again next year, anyone?

Leaving London

A few weeks ago, I left Folder Towers in sunny Shoreditch, packed all my worldly possessions into cardboard boxes, and headed back up to Manchester.

My year-long stint at Folder was part of my Computer Science degree – a year in industry that I was allowed to find my own job for. After applying for (and eventually being rejected by) several big name banks, I decided to fire off e-mails to various contacts (hi, Andy) and see if they had any suggestions. Long story short – one Mr. Matt Deegan turned up, took a punt on a random student, and I spent an excellent 12 months with Folder Media.

This is a very quick, and admittedly very belated, post to thank some of the people who’ve helped me out during the year – everyone at Folder Media, Hallett Arendt, the Global Radio Creative Technology Team, and the Radio Academy, thank you all for your help/advice/tea over the past year.

I’m proud of the things we’ve made and achieved in the past year, if you get a spare five minutes with Matt, then make sure you persuade him to show some of it off to you. I’m carrying on working with Folder Media part-time whilst in Manchester, so watch out London – I’ll be back.