Supplement(3pm)
π NAME π
XMLTV::Supplement β the supplementary file loader for XMLTV grabbers, bestie. It's giving backstage pass for your xmltv-distribution programs. π
β¨ DESCRIPTION β¨
Okay so picture this: it's a utility library, and its whole job is loading up supplementary files for xmltv-grabbers and the other programs chillin' in the xmltv-distribution. π
These supplementary files can come from http or from a local file β it just depends on how the module is configured. The default? It pulls them straight from http://supplement.xmltv.org. π
Wanna change that? Easy. Just set the environment variable XMLTV_SUPPLEMENT to the new root-directory or root-url for your supplementary files. That's it, that's the whole vibe change. π¦
πΈ EXPORTED FUNCTIONS πΈ
Heads up bestie: all of these functions are exported on demand. Not just handed to you for free. π
GetSupplement
Loads a supplement file and returns it as a string. Takes two parameters: directory and filename.
my $content = GetSupplement( 'tv_grab_uk_rt', 'channel_ids' );
GetSupplement will always return a string with the content. But if it can't get the content?? It prints an error-message and aborts the program. No cap. π
GetSupplementLines
Loads a supplement file and returns it as an array. Any comments or blank lines get removed (so clean β¨). Takes two parameters: directory and filename.
my $content = GetSupplementLines( 'tv_grab_uk_rt', 'channel_ids' );
GetSupplementLines will always return an array with the content. And yeah, same energy as above: if it fails to get the content, it prints an error-message and aborts the program. π
GetSupplementFile
Get the supplement file from the local machine. π₯οΈ
GetSupplementUrl
Get the supplement file from a URL. π
GetSupplementDir
Get the base directory containing supplementary files.
e.g. $ENV{HOME}/.xmltv/supplement
SetSupplementRoot
Set the root directory for loading supplementary files.
SetSupplementRoot( '/usr/share/xmltv' );
SetSupplementRoot( 'http://my.server.org/xmltv' );
GetSupplementRoot
Get the root directory for loading supplementary files. That's it. π
π§ CACHING π§
The module stores all downloaded files in a cache, bestie. It lives on disk:
- On Unix:
~/.xmltv/supplement - On Windows:
CSIDL_LOCAL_APPDATA//xmltv/supplement
Here's the tea on how it decides what to serve you β:
- If a file was downloaded less than 1 hour ago, the file from the cache is used without contacting the server. Zero calls, zero waiting. Slay. β¨
- Otherwise, if the file was downloaded more than 1 hour ago, the module checks with the server to see if an updated file is available, and downloads it if necessary.
And if the server does not respond, or returns an error-message? A warning gets printed to STDERR, and the file from the cache is used instead. So you're never left hanging. π«Ά
π ENVIRONMENT VARIABLES π
The XMLTV_SUPPLEMENT environment variable can be used to tell the module where the supplementary files are found. πΊοΈ
XMLTV_SUPPLEMENT=/usr/share/xmltv
XMLTV_SUPPLEMENT=http://supplementary.xmltv.se
The XMLTV_SUPPLEMENT_VERBOSE environment variable can be used to get more debug output from XMLTV::Supplement. π
XMLTV_SUPPLEMENT_VERBOSE=1
π COPYRIGHT π
Copyright (C) 2007 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.
Okay that's the whole page, bestie!! This was perl v5.40.1, dated 2025-04-19, section 3pm, and it's literally iconic. Go forth and supplement your xmltv files π
β¨π
π¦ 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