Page 1 of 1

Gathering extended data with XMLTV?

Posted: Sat Nov 17, 2007 9:16 pm
by ricks03
I've been digging through xmltv.pm 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 summarize.pm, how can I get that information in the same general format? (channel, start, stop, name, etc).

Thanks

Rick

Re: Gathering extended data with XMLTV?

Posted: Sun Nov 18, 2007 12:26 am
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.

Robert