Getting TV listings data? rss?

Soldato
Joined
18 Oct 2002
Posts
9,047
Location
London
Is there any kind of rss feed or website where you can obtain tv listings data? i.e. for making your own programs or perhaps some sort of webapp?

I mean you could use the direct source output from somewhere like radiotimes but it would be a bit of a mission, especially when they change the site in anyway (even though it's currently quite nice with <li> elements).

I found this site, but it's not great
http://www.mightyv.com/search?service_type=tv&pre=whats_on_now&format=rss
 
Last edited:
There are plenty of plugins for Samurize which will give you that sort of info. I'm not sure if they use RSS under the skin though so grabbing the data into something else might be tricky.
 
I don't know if the the samurize scripts are better these days, but in the past they were forever not working right, or not working at all.

I found this quite good site:

http://www.bleb.org/tv/data/listings/0/bbc1.xml

I reckon it'd be a piece of cake to do something with those files and php5. Although it'd be probably be 'nice' to cache the information somewhere first.
 
well i was bored so i whipped up a little script for bbc1... :p

Code:
<?php
$remotefile = "http://www.bleb.org/tv/data/listings/0/bbc1.xml";
$xml = @simplexml_load_file($remotefile);
echo "<h1>".$xml['id']." ".$xml['date']."</h1>";
foreach ($xml->programme as $programme){
	echo "<h4>".$programme->title." ".$programme->start." - ".$programme->end."</h4>";
	echo "<p>".$programme->desc."</p>";
}
?>

looks like this.... :o

untitledik6.jpg


i'm sure you can do much better. no caching support either.... :p
 
Last edited:
Haha, yeah you gotta love that simplexml!

Do you reckon the best way of caching would be to automagically create a copy of the xml files every day (or week), and then access those ones?
 
my sig has caching support as it's easy to implement based on the age of the cached file. for instance my recent tracks one grabs a new update when my cached file is more than 3 minutes old or 6 hours for other chart types.

Code:
$remotefile = "http://ws.audioscrobbler.com/1.0/user/$user/$type.xml";
$localfile = "cache/".$user.$type.".xml";
if ($type == "recenttracks") { 
    $cache = 180; 
} else {
    $cache = 21600;
}
//if local xml file does not exist or it's older than limit....
if ((!file_exists($localfile)) || (time()-filemtime($localfile)>$cache)) {
    $contents = @file_get_contents($remotefile);
    $fp = fopen($localfile, "w");
    fwrite($fp, $contents); 
    fclose($fp);
}
$xml = @simplexml_load_file($localfile);

with yours it's different as you'll need to enable caching based on the time of day/week as opposed to how old the cached xml file is. not too sure how to go about that. :o
 
lol it's no wonder samurize had so many problems.. That link just brings up a load of garbage for me?

It's surprising there's not a good one for the vista sidebar yet, hopefully it'll be just a matter of time.
 
Visage said:
Be wared that most TV listings dayta is copyrighted, so most of the stuff here is illegal...

well according to this page, they can't list itv for that reason....

http://www.bleb.org/tv/

ITV listings are now unavailable due to legal reasons. If/when I can arrange with ITV a machine readable, royalty free version of their listings they will return. Sorry for the inconvenience. More information is available in my diary. Piers Roberts has created a petition.

given that, i'd assume they have permission for all other channels? :)
 
Visage said:
Be wared that most TV listings dayta is copyrighted, so most of the stuff here is illegal...

Jesus, stop trying to be a wannabe mod. If you had actually taken the time you would have realised that XMLTV formatted data provided by the Radio Times is free for personal use:

XMLTV Web site said:
The tvgrabuk_rt grabber gets machine-readable data from the radiotimes.com site. They would like me to point out that all data is the copyright of the Radio Times website and the use of this data is restricted to personal use only.

The Bleb stuff is probably a little more questionable but it's hardly worth getting your knickers in a twist. It's been around for years and no one's kicked up a fuss, except ITV. In fact, the Bleb data was used by the BBC backstage competetion winner Mightyv a while back.
 
marc2003 said:
well according to this page, they can't list itv for that reason....

http://www.bleb.org/tv/



given that, i'd assume they have permission for all other channels? :)

Yes - *they* may have permission. You, however, do not necessarily. Its akin to a publisher having the right to reproduce an authors work. That does not mena that you in turn could transcribe that work and distribute it....
 
Back
Top Bottom