.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Supplement 3pm" .TH Supplement 3pm 2024-02-24 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME XMLTV::Supplement \- Supplementary file loader for XMLTV grabbers .SH DESCRIPTION .IX Header "DESCRIPTION" Utility library that loads supplementary files for xmltv-grabbers and other programs in the xmltv-distribution. .PP Supplementary files can be loaded either via http or from a local file, depending on the configuration of the module. The default is to load the files from http://supplement.xmltv.org. This can be changed by setting the environment variable XMLTV_SUPPLEMENT to the new root-directory or root-url for supplementary files. .SH "EXPORTED FUNCTIONS" .IX Header "EXPORTED FUNCTIONS" All these functions are exported on demand. .IP GetSupplement 4 .IX Item "GetSupplement" Load a supplement file and return it as a string. Takes two parameters: directory and filename. .Sp .Vb 1 \& my $content = GetSupplement( \*(Aqtv_grab_uk_rt\*(Aq, \*(Aqchannel_ids\*(Aq ); .Ve .Sp GetSupplement will always return a string with the content. If it fails to get the content, it prints an error-message and aborts the program. .IP GetSupplementLines 4 .IX Item "GetSupplementLines" Load a supplement file and return it as an array. Any comments or blank lines will be removed. Takes two parameters: directory and filename. .Sp .Vb 1 \& my $content = GetSupplementLines( \*(Aqtv_grab_uk_rt\*(Aq, \*(Aqchannel_ids\*(Aq ); .Ve .Sp GetSupplementLines will always return an array with the content. If it fails to get the content, it prints an error-message and aborts the program. .IP GetSupplementFile 4 .IX Item "GetSupplementFile" Get the supplement file from the local machine .IP GetSupplementUrl 4 .IX Item "GetSupplementUrl" Get the supplement file from a URL .IP GetSupplementDir 4 .IX Item "GetSupplementDir" Get the base directory containing supplementary files. e.g. \f(CW$ENV\fR{HOME}/.xmltv/supplement .IP SetSupplementRoot 4 .IX Item "SetSupplementRoot" Set the root directory for loading supplementary files. .Sp .Vb 2 \& SetSupplementRoot( \*(Aq/usr/share/xmltv\*(Aq ); \& SetSupplementRoot( \*(Aqhttp://my.server.org/xmltv\*(Aq ); .Ve .IP GetSupplementRoot 4 .IX Item "GetSupplementRoot" Get the root directory for loading supplementary files. .SH CACHING .IX Header "CACHING" The module stores all downloaded files in a cache. The cache is stored on disk in ~/.xmltv/supplement on Unix and in CSIDL_LOCAL_APPDATA//xmltv/supplement on Windows. .PP If a file has been downloaded less than 1 hour ago, the file from the cache is used without contacting the server. Otherwise, if the file has been downloaded more than 1 hour ago, then the module checks with the server to see if an updated file is available and downloads it if necessary. .PP If the server does not respond or returns an error-message, a warning is printed to STDERR and the file from the cache is used. .SH "ENVIRONMENT VARIABLES" .IX Header "ENVIRONMENT VARIABLES" The XMLTV_SUPPLEMENT environment variable can be used to tell the module where the supplementary files are found. .PP .Vb 2 \& XMLTV_SUPPLEMENT=/usr/share/xmltv \& XMLTV_SUPPLEMENT=http://supplementary.xmltv.se .Ve .PP The XMLTV_SUPPLEMENT_VERBOSE environment variable can be used to get more debug output from XMLTV::Supplement. .PP .Vb 1 \& XMLTV_SUPPLEMENT_VERBOSE=1 .Ve .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (C) 2007 Mattias Holmlund. .PP 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. .PP 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. .PP 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.