Configure(3pm)
β¨ NAME β¨
okay so this is XMLTV::Configure π β it's the configuration file handling bestie for XMLTV grabbers. she's the one who reads your config files and makes the whole "configure it from the command line" thing happen π
πΈ DESCRIPTION πΈ
it's a utility library, periodt. she helps grabbers do two iconic things:
- read from configuration files π
- implement a configuration method that can be run straight from the command-line π
π¦ EXPORTED FUNCTIONS π¦
heads up bestie: all these functions are exported on demand β¨
π LoadConfig
takes the name of the configuration file to load as a parameter. that's it, that's the vibe π«Ά
returns a hashref with configuration fieldnames as keys. and ngl, the tea here is that the values of the hash are references to an array of values β not just plain values, okay? don't come for me π
Example:
{
username => [ 'mattias' ],
password => [ 'xxx' ],
channel => [ 'svt1.svt.se', 'kanal5.se' ],
no_channel => ['svt2.svt.se' ],
}
now listen, this part is lowkey important π’ β unselected options from a selectmany get collected in an entry named after the key with a prefix of no_. see the channel and no_channel entries in the example? those are the result of a selectmany with id=channel. iykyk π
the configuration file must be in the format described in the file "ConfigurationFiles.txt". and fr fr β if the file does not exist, or if the format is wrong, LoadConfig returns undef. no config, no slay π
π SaveConfig
writes a configuration hash β in the format returned by LoadConfig β to a file that can be loaded back with LoadConfig. takes two parameters: a reference to a configuration hash, and a filename π
note bestie: a grabber should normally never have to call SaveConfig. this is done by the Configure-method. so like, don't do it manually, she's got it π«Ά
π Configure
generates a configuration file for the grabber. main character energy tbh β¨
takes three parameters: stagesub, listsub, and the name of the configuration file.
stagesub shall be a coderef that takes a stage-name or undef and a configuration hashref as a parameter, and returns an xml-string that describes the configuration necessary for that stage. the xml-string shall follow the xmltv-configuration.dtd π
listsub shall be a coderef that takes a configuration hash as returned by LoadConfig as the first parameter and an option hash as returned by ParseOptions as the second parameter, and returns an xml-string containing a list of all the channels that the grabber can deliver data for using the supplied configuration. and this is the crucial bit, don't miss it π β the listsub shall not use any channel-configuration from the hashref. none. zero. nada π«
π COPYRIGHT π
Copyright (C) 2005 Mattias Holmlund.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
and that's the whole page bestie, no notes π
β¨ this was pulled from perl v5.40.1, dated 2025-04-19, under the Configure(3pm) name β mwah, go configure something cute ππ
π¦ where this page comes from
- debian trixie: libxmltv-perl 1.4.0-1 Β· GPL-2.0-only
- ubuntu resolute: libxmltv-perl 1.4.0-1 Β· GPL-2.0-only
- ubuntu stonking: libxmltv-perl 1.4.0-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms