Gathering extended data with XMLTV?

Discussion about Schedules Direct grabber code and data formats.
Post Reply
Posts: 3
Joined: Tue Nov 13, 2007 7:44 pm

Gathering extended data with XMLTV?

Post by ricks03 »

I've been digging through and associated modules, and can't find the answer I was. I know it's probably obvious. . .

I'm capturing the data using xmltv (xmltv-0.5.49) and that's working fine, returning a XML file. (love XMLTV).

However, there's a LOT of information in there I'd like to reference/extract that I can't figure out how. (not a perl whiz, don't even play one on tv).

I'm using:
my ($encoding, $credits, $ch, $progs) = @{XMLTV::parsefiles($parms{infile})};
foreach (summarize($ch, $progs)) {
my ($time_start, $time_end, $pgm_name, $pgm_title, $channel_number ) = @$_;
which is working fine, but that only gives me the obvious. I'd like to get the descriptions, the rating, and the categories out of the XML as well (and really, everything else), but when I look through summarize() it doesn't return anything else. Besides having to hack, how can I get that information in the same general format? (channel, start, stop, name, etc).


SD Board Member
Posts: 1611
Joined: Tue Aug 14, 2007 2:31 pm
Location: Cedar Hill, TX

Re: Gathering extended data with XMLTV?

Post by rmeden »

Take a look at my source for TV_CHECK (it's in the XMLTV choose directory), load_guide function (line 1623)

I don't use summarize, but do read the file with parsefile.

It looks like " my $xml = XMLTV::parsefile($file); " returns channels as a hash and guide data as an array. In TV_CHECK, I then go through the GUIDE array building a bunch of hashes for indexes.

That code should show you know how to get the details out.

BTW... when playing with this sort of code the Data::Dumper module is your best friend.

Post Reply