SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE


YUM REPOSITORY

 
 

MAN page from RedHat EL 7 perl-XMLTV-0.6.1-7.el7.noarch.rpm

grab::Grab_XML

Section: User Contributed Perl Documentation (3)
Updated: 2019-02-21
Index 

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 formatfrom some website and output the data. It is not used for grabberswhich scrape human-readable sites.

It consists of several class methods (package methods). The way touse 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 mightwant 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 thatdate can be downloaded. This method is abstract, you must overrideit.

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 defaultimplementation just returns the data unchanged, but you might overrideit 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 itthen attempts to --configure will give a message that configuration isnot 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 usagemessages. Abstract.
XMLTV::Grab_XML->usage_msg()
Return a command-line usage message. This calls "country()", so youprobably need to override only that method.
XMLTV::Grab_XML->get()
Given a URL, fetch the content at that URL. The defaultimplementation calls XMLTV::Get_nice::get_nice() but you might want tooverride it if you need to do wacky things with http requests, likecookies.

Note that while this method fetches a page, "xml_from_data()" doesany 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 alsocalls 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 bememoized between runs. This will normally be whatever functionfetches the web pages - you memoize that to save on repeateddownloads. A subclass might want to add things to this listif 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 correctReturns: the corrected XML

 

AUTHOR

Ed Avis, edAATTmembled.com 

SEE ALSO

perl(1), XMLTV(3).


 

Index

NAME
SYNOPSIS
DESCRIPTION
METHODS
AUTHOR
SEE ALSO

This document was created byman2html,using the manual pages.