Summarize(3)

πŸ“¦ version 1.4.0, in alpine 3.24

πŸ’– 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