DESCRIPTION

Utility library that loads supplementary files for xmltv-grabbers and other programs in the xmltv-distribution.

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 \s-1XMLTV_SUPPLEMENT\s0 to the new root-directory or root-url for supplementary files.

EXPORTED FUNCTIONS

All these functions are exported on demand.

GetSupplement

Load a supplement file and return 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. If it fails to get the content, it prints an error-message and aborts the program.

SetSupplementRoot

Set the root directory for loading supplementary files. SetSupplementRoot( '/usr/share/xmltv' ); SetSupplementRoot( 'http://my.server.org/xmltv' );

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.

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.

If the server does not respond or returns an error-message, a warning is printed to \s-1STDERR\s0 and the file from the cache is used.

ENVIRONMENT VARIABLES

The \s-1XMLTV_SUPPLEMENT\s0 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 \s-1XMLTV_SUPPLEMENT_VERBOSE\s0 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 \s-1GNU\s0 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 \s-1WITHOUT\s0 \s-1ANY\s0 \s-1WARRANTY\s0; without even the implied warranty of \s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. See the \s-1GNU\s0 General Public License for more details.

You should have received a copy of the \s-1GNU\s0 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, \s-1MA\s0 02110-1301, \s-1USA\s0.