| 1 | package WebSource::Fetcher::xml; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use LWP::UserAgent; | ||
| 5 | use HTTP::Cookies; | ||
| 6 | use WebSource::Parser; | ||
| 7 | use WebSource::Fetcher; | ||
| 8 | use WebSource::XMLParser; | ||
| 9 | |||
| 10 | use Carp; | ||
| 11 | |||
| 12 | our @ISA = ('WebSource::Fetcher','WebSource::XMLParser'); | ||
| 13 | |||
| 14 | =head1 NAME | ||
| 15 | |||
| 16 | WebSource::Fetcher::xml : fetching module | ||
| 17 | When run downloads given urls and returns the corresponding documents | ||
| 18 | |||
| 19 | =head1 DESCRIPTION | ||
| 20 | |||
| 21 | =head1 SYNOPSIS | ||
| 22 | |||
| 23 | $fetcher = WebSource::Fetcher::xml->new(wsnode => $node); | ||
| 24 | |||
| 25 | # for the rest it works as a WebSource::Module | ||
| 26 | |||
| 27 | =head1 METHODS | ||
| 28 | |||
| 29 | =over 2 | ||
| 30 | |||
| 31 | =item B<< $source = WebSource->new(desc => $node); >> | ||
| 32 | |||
| 33 | Create a new Fetcher; | ||
| 34 | |||
| 35 | =cut | ||
| 36 | |||
| 37 | sub _init_ { | ||
| 38 | my $self = shift; | ||
| 39 | $self->WebSource::Fetcher::_init_; | ||
| 40 | $self->WebSource::XMLParser::_init_; | ||
| 41 | } | ||
| 42 | |||
| 43 | =item B<< $fetcher->handle($env); >> | ||
| 44 | |||
| 45 | Builds an HTTP::Request from the data in enveloppe, fetches | ||
| 46 | the URI (eventually stores it in a file) and builds | ||
| 47 | the corresponding DOM object | ||
| 48 | |||
| 49 | =cut | ||
| 50 | |||
| 51 | sub handle { | ||
| 52 | my ($self,$env) = @_; | ||
| 53 | return WebSource::XMLParser::handle($self, | ||
| 54 | WebSource::Fetcher::handle($self,$env)); | ||
| 55 | } | ||
| 56 | |||
| 57 | =back | ||
| 58 | |||
| 59 | =head1 SEE ALSO | ||
| 60 | |||
| 61 | WebSource::Module | ||
| 62 | |||
| 63 | =cut | ||
| 64 | |||
| 65 | 1; |