Summarize(3)
π NAME π
okay bestie, this is the Summarize(3) page from the User Contributed Perl Documentation, and it's all about XMLTV::Summarize β a Perl extension to summarize XMLTV data. periodt β¨
πΈ SYNOPSIS πΈ
first you gotta get some data from the XMLTV module, like this:
# First get some data from the XMLTV module, eg:
use XMLTV;
my $data = XMLTV::parsefile('tv_sorted.xml');
my ($encoding, $credits, $ch, $progs) = @$data;
# Now turn the sorted programmes into a printable summary.
use XMLTV::Summarize qw(summarize);
foreach (summarize($ch, $progs)) {
if (not ref) {
print "\nDay: $_\n\n";
}
else {
my ($start, $stop, $title, $sub_title, $channel) = @$_;
print "programme starts at $start, ";
print "stops at $stop, " if defined $stop;
print "has title $title ";
print "and episode title $sub_title" if defined $sub_title;
print ", on channel $channel.\n";
}
}
π¦ DESCRIPTION π¦
okay so this module processes programme and channel data from the XMLTV module to help produce a human-readable summary or TV guide. it literally takes care of choosing the correct language β based on the LANG environment variable β and of looking up the name of channels from their id. so helpful, honestly π«Ά
there is one public routine, summarize(). it takes (references to) a channels hash and a programmes list, the same format as those returned by the XMLTV module. it returns a list of 'summary' elements where each element is a list of five items: start time, stop time, title, 'sub-title', and channel name. the stop time and sub-title may be undef. iconic little data structure tbh π
the times are formatted as hh:mm, with a timezone appended when the timezone changes in the middle of listings. for the titles and channel name, the shortest string that is in an acceptable language is chosen. shortest-string slay β¨
the list of acceptable languages normally contains just one element, taken from LANG, but you can set it manually as @XMLTV::Summarize::PREF_LANGS if wished. iykyk π
π AUTHOR π
Ed Avis, ed@membled.com
π SEE ALSO π
XMLTV(1).
that's the Summarize(3) tea, brewed by perl v5.42.2 on 2025-06-30 β mwah, bestie ππ
π¦ where this page comes from
- alpine 3.24: xmltv-doc 1.4.0-r1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms