.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 "grab::Grab_XML 3pm" .TH grab::Grab_XML 3pm "2021-02-09" "perl v5.32.1" "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::Grab_XML \- Perl extension to fetch raw XMLTV data from a site .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 6 \& package Grab_XML_rur; \& use base \*(AqXMLTV::Grab_XML\*(Aq; \& sub urls_by_date( $ ) { my $pkg = shift; ... } \& sub country( $ ) { my $pkg = shift; return \*(AqRuritania\*(Aq } \& # Maybe override a couple of other methods as described below... \& Grab_XML_rur\->go(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module helps to write grabbers which fetch pages in \s-1XMLTV\s0 format from some website and output the data. It is not used for grabbers which scrape human-readable sites. .PP It consists of several class methods (package methods). The way to use it is to subclass it and override some of these. .SH "METHODS" .IX Header "METHODS" .IP "XMLTV::Grab_XML\->\fBdate_init()\fR" 4 .IX Item "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. .IP "XMLTV::Grab_XML\->\fBurls_by_date()\fR" 4 .IX Item "XMLTV::Grab_XML->urls_by_date()" Returns a hash mapping \s-1YYYYMMDD\s0 dates to a \s-1URL\s0 where listings for that date can be downloaded. This method is abstract, you must override it. .Sp Arguments: the command line options for \-\-config\-file and \-\-quiet. .IP "XMLTV::Grab_XML\->xml_from_data(data)" 4 .IX Item "XMLTV::Grab_XML->xml_from_data(data)" Given page data for a particular day, turn it into \s-1XML.\s0 The default implementation just returns the data unchanged, but you might override it if you need to decompress the data or patch it up. .IP "XMLTV::Grab_XML\->\fBconfigure()\fR" 4 .IX Item "XMLTV::Grab_XML->configure()" Configure the grabber if needed. Arguments are \-\-config\-file option (or undef) and \-\-quiet flag (or undef). .Sp 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. .IP "XMLTV::Grab_XML\->nextday(day)" 4 .IX Item "XMLTV::Grab_XML->nextday(day)" Bump a \s-1YYYYMMDD\s0 date by one. You probably shouldn't override this. .IP "XMLTV::Grab_XML\->\fBcountry()\fR" 4 .IX Item "XMLTV::Grab_XML->country()" Return the name of the country you're grabbing for, used in usage messages. Abstract. .IP "XMLTV::Grab_XML\->\fBusage_msg()\fR" 4 .IX Item "XMLTV::Grab_XML->usage_msg()" Return a command-line usage message. This calls \f(CW\*(C`country()\*(C'\fR, so you probably need to override only that method. .IP "XMLTV::Grab_XML\->\fBget()\fR" 4 .IX Item "XMLTV::Grab_XML->get()" Given a \s-1URL,\s0 fetch the content at that \s-1URL.\s0 The default implementation calls \fBXMLTV::Get_nice::get_nice()\fR but you might want to override it if you need to do wacky things with http requests, like cookies. .Sp Note that while this method fetches a page, \f(CW\*(C`xml_from_data()\*(C'\fR does any further processing of the result to turn it into \s-1XML.\s0 .IP "XMLTV::Grab_XML\->\fBgo()\fR" 4 .IX Item "XMLTV::Grab_XML->go()" The main program. Parse command line options, fetch and write data. .Sp Most of the options are fairly self-explanatory but this routine also calls the XMLTV::Memoize module to look for a \fB\-\-cache\fR argument. The functions memoized are those given by the \f(CW\*(C`cachables()\*(C'\fR method. .IP "XMLTV::Grab_XML\->\fBcachables()\fR" 4 .IX Item "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. .IP "XMLTV::Grab_XML\->\fBremove_early_stop_times()\fR" 4 .IX Item "XMLTV::Grab_XML->remove_early_stop_times()" Checks each stop time and removes it if it's before the start time. .Sp Argument: the \s-1XML\s0 to correct Returns: the corrected \s-1XML\s0 .SH "AUTHOR" .IX Header "AUTHOR" Ed Avis, ed@membled.com .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBperl\fR\|(1), \s-1\fBXMLTV\s0\fR\|(3).