Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xmltv::grab_xml(3pm) [debian man page]

grab::Grab_XML(3pm)					User Contributed Perl Documentation				       grab::Grab_XML(3pm)

NAME
XMLTV::Grab_XML - Perl extension to fetch raw XMLTV data from a site SYNOPSIS
package Grab_XML_rur; use base 'XMLTV::Grab_XML'; sub urls_by_date( $ ) { my $pkg = shift; ... } sub country( $ ) { my $pkg = shift; return 'Ruritania' } # Maybe override a couple of other methods as described below... Grab_XML_rur->go(); DESCRIPTION
This module helps to write grabbers which fetch pages in XMLTV format from some website and output the data. It is not used for grabbers which scrape human-readable sites. It consists of several class methods (package methods). The way to use it is to subclass it and override some of these. METHODS
XMLTV::Grab_XML->date_init() Called at the start of the program to set up Date::Manip. You might want to override this with a method that sets the timezone. XMLTV::Grab_XML->urls_by_date() Returns a hash mapping YYYYMMDD dates to a URL where listings for that date can be downloaded. This method is abstract, you must override it. Arguments: the command line options for --config-file and --quiet. XMLTV::Grab_XML->xml_from_data(data) Given page data for a particular day, turn it into XML. The default implementation just returns the data unchanged, but you might override it if you need to decompress the data or patch it up. XMLTV::Grab_XML->configure() Configure the grabber if needed. Arguments are --config-file option (or undef) and --quiet flag (or undef). This method is not provided in the base class; if you don't provide it then attempts to --configure will give a message that configuration is not necessary. XMLTV::Grab_XML->nextday(day) Bump a YYYYMMDD date by one. You probably shouldn't override this. XMLTV::Grab_XML->country() Return the name of the country you're grabbing for, used in usage messages. Abstract. XMLTV::Grab_XML->usage_msg() Return a command-line usage message. This calls "country()", so you probably need to override only that method. XMLTV::Grab_XML->get() Given a URL, fetch the content at that URL. The default implementation calls XMLTV::Get_nice::get_nice() but you might want to override it if you need to do wacky things with http requests, like cookies. Note that while this method fetches a page, "xml_from_data()" does any further processing of the result to turn it into XML. XMLTV::Grab_XML->go() The main program. Parse command line options, fetch and write data. Most of the options are fairly self-explanatory but this routine also calls the XMLTV::Memoize module to look for a --cache argument. The functions memoized are those given by the "cachables()" method. XMLTV::Grab_XML->cachables() Returns a list of names of functions which could reasonably be memoized between runs. This will normally be whatever function fetches the web pages - you memoize that to save on repeated downloads. A subclass might want to add things to this list if it has its own way of fetching web pages. XMLTV::Grab_XML->remove_early_stop_times() Checks each stop time and removes it if it's before the start time. Argument: the XML to correct Returns: the corrected XML AUTHOR
Ed Avis, ed@membled.com SEE ALSO
perl(1), XMLTV(3). perl v5.14.2 2006-01-08 grab::Grab_XML(3pm)

Check Out this Related Man Page

Supplement(3pm) 					User Contributed Perl Documentation					   Supplement(3pm)

NAME
XMLTV::Supplement - Supplementary file loader for XMLTV grabbers 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 XMLTV_SUPPLEMENT 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 STDERR and the file from the cache is used. 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. perl v5.14.2 2012-06-30 Supplement(3pm)
Man Page