Configure(3)

πŸ“¦ version 1.4.0, in alpine 3.24

πŸ’– NAME πŸ’–

okay so welcome to Configure(3) from the User Contributed Perl Documentation collection, bestie πŸ’… This page is all about XMLTV::Configure β€” Configuration file handling for XMLTV grabbers. That's the whole vibe.

✨ DESCRIPTION ✨

XMLTV::Configure is a utility library that helps grabbers read from configuration files and implement a configuration method that can be run from the command-line. Periodt.

🌸 EXPORTED FUNCTIONS 🌸

All these functions are exported on demand β€” you ask, they appear, no cap.

πŸŽ€ LoadConfig πŸŽ€

You pass it the name of the configuration file to load as a parameter.

It returns a hashref with configuration fieldnames as keys. Heads up: the values of the hash are references to an array of values.

Example:

{
  username => [ 'mattias' ],
  password => [ 'xxx' ],
  channel => [ 'svt1.svt.se', 'kanal5.se' ],
  no_channel => ['svt2.svt.se' ],
}

Also, unselected options from a selectmany are collected in an entry named after the key with a prefix of no_. See the channel and no_channel entry in the example β€” they are the result of a selectmany with id=channel.

The configuration file must be in the format described in the file ConfigurationFiles.txt. If the file does not exist or if the format is wrong, LoadConfig returns undef. 🫢

πŸŽ€ SaveConfig πŸŽ€

Write a configuration hash in the format returned by LoadConfig to a file that can be loaded with LoadConfig. Takes two parameters, a reference to a configuration hash and a filename.

Note that a grabber should normally never have to call SaveConfig β€” this is done by the Configure-method. So like, don't stress about it, okay?

πŸŽ€ Configure πŸŽ€

Generates a configuration file for the grabber.

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. Note that the listsub shall not use any channel-configuration from the hashref. Iconic behavior only πŸ’…

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.


πŸ’– bye bestie β€” this page is from perl v5.42.2, dated 2025-06-30. mwah πŸ’…βœ¨

πŸ“¦ where this page comes from