All About Radio 2 Schedules

[This post is courtesy of one of our developers, Keith Murray]
As you are probably aware of from the other articles on this site, the folks at Radio Two have rolled out their new lineup of shows. What you may not realize is that at the same time, a small group of folks at CBC.ca have been working overtime to set up a landing page to support the new look and feel of Radio Two.
Whats New?
Some of the cool things on the new landing page are detailed schedules, program descriptions and host bios, and playlists for the shows. The playlists come from an internal system called INews that I know nothing about. The show listings and bios come from another internalsystem called Program Guide, and that’s something I know about.
Before I get all technical and tell you about how the listings and bios get to the new Radio Two landing page, let me describe my relationship with Program Guide.
Some History.
Way back in the 1980s, I would ride my bike to Greenly’s Bookstore in downtown Belleville once a month and buy a copy of The National Radio Guide. It was a glossy magazine published by the CBC that had articles, detailed show descriptions, and bios of on-air personalities. The best thing is that it also had the complete Radio and Stereo (now known as Radio One and Radio Two) schedules. Never again would I miss an interesting episode of Ideas, with Lister Sinclair.
Check out these scans from the February 1989 edition. Ahhh, Morningside, Brave New Waves, Night Lines…
The CBC stopped publishing the Radio Guide in the late 1990s, and they now publish listings on the Program Guide.
When I started working at CBC.ca, I found out that the Program Guide application was in need of an owner. Nobody wanted to maintain the code. But for me it was like meeting an old friend, so I gladly took it over. It didn’t take me long to find out why people avoided it.
Mouldy Code
Program Guide is suffering from bit rot. It’s old, and too many features have been hacked on. As well, every time somebody accesses a schedule, the application dynamically looks up the schedule in a database, and creates a nicely formatted page, just for you. Every time. It has to, because the local morning show in Tofino isn’t the same as in Montreal. But, that’s just not very efficient, and Program Guide crashes often.
Ok, I’m finally going to talk about how the schedules on the new landing page work.
When the Radio Two folks approached me with the idea of the new landing page pulling data from Program Guide dynamically, I originally said “No way, it will never handle the load!”. However, it was mentioned that the new Radio Two schedule had no local programming, so it only had to look up the schedule once per day, and it would be the same for all time zones (“half an hour later in
Newfoundland”). That I could live with.
So once per day, the Radio Two schedule, the show descriptions, and host bios are retrieved from Program Guide and stored in a file format called XML. XML files are an easy way to store lots of related information in a simple file that can be read with any text editor. It’s also easy to write other programs that read XML files and do something useful with them. For example, our podcasts are served up via RSS feeds, which are really just XML files.
Here is a snippet of the schedule for Saturday night in XML.
<schedule>
<timeslot>
<startdate>2007/03/25</startdate>
<starttime>20:00</starttime>
<endtime>22:00</endtime>
<title><![CDATA[Canada Live - With Patti Schmidt]]></title>
<episode></episode>
<shortdescription><![CDATA[Listeners will be transported to concert halls, music clubs and festival stages across the country for live performances]]></shortdescription>
</timeslot>
</schedule>
The XML files with the schedule information are transformed into HTML files on the landing page via XSLT. XSLT is a fairly efficient way to take XML files and transform them into something else, usually while adding formatting or other display components to
the data.
Here is a snipped of the XSLT file that correlates the programs with the host bios.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" indent="yes" omit-xml-declaration="yes"/>
<xsl:param name="param1" />
<xsl:variable name="titleKey">
<xsl:value-of select="$param1" />
</xsl:variable>
<xsl:template match="/">
<xsl:for-each select="personalities/personality[./title=$titleKey]">
name: <xsl:value-of select="concat(firstName, ' ' , lastName)"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
This is what it ends up looking like on the new landing page.

The core schedule data is still coming from Program Guide. However, with the new Radio Two landing page it’s much more efficient, as the information is only read once per day, for everybody, in any time zone.
Note from Blake: The program guide is slated to be revamped with performance increases and easier to use interface. For all your Radio 2 needs you can go straight to the Radio 2 website and not have to use Program Guide at all.
|
|
Email This Post |
| CBC.ca web site, Under the Hood |




















I hate Program Guide with a passion, for the aforementioned reasons, as well as the fact that My CBC refuses to store my postal code, timing out whenever I try to save it to my profile. (This also happens when I try to subscribe to an email newsletter like Hotsheets, which is really annoying.) I was delighted to see the awesome new interface for Radio Two, and hope to see something similar for Radio One in the near future.
Keith: Since you’ve mentioned the Program Guide and RSS syndication in the same article (if not exactly the same breath), what are the chances of eventually being able to subscribe to a Program Guide feed, be it for everything or just a particular show? It wouldn’t be quite the same as the Radio Guide, but it could be even more useful: for pre-scheduled programs like (ironically?) Canada Live the feed might contain the next month’s worth of concerts, exactly as RG used to have, and for programs like As It Happens it might contain that evening’s lineup. Jowi Taylor’s Radio 2 blog fills a bit of that gap, but it’s not comprehensive (nor should it be).
Hi Peter.
We are still in the process of determining what the required functionality of ‘Program Guide 2′ should be. Our main concern is to make it stable, but we also want it to be useful. I’ll put your idea on our list of possible features. Thanks.
Any chance we could get links to the program pages from the schedule? That would be awesome.
Rachel,
I’m assuming that you mean the difference between:
http://www.cbc.ca/programguide/program/index.jsp?program=Music+and+Company
and
http://www.cbc.ca/musicandcompany/
We will definitely be linking to the ‘real’ program page by default, if it exists. If there is no program page set up, we will then link to the ‘generic’ page.
I also want to add that we are just in the concept phase for ‘Program Guide 2′. There is no timeline yet for when we will begin putting it all together.
I also used to buy the National Radio Guide and was really disappointed when CBC stopped publishing it. The guide was very well put together and the information was current. Now of course I check for program info through the CBC website and its various links. But the online data is often out of date. It’s not unusual to see a show listed (with its own website still intact) which has been cancelled and off the air for awhile. Is there a lot of red tape involved in getting these things corrected?