WWW::GoKGS::Scraper - Abstract base class for KGS scrapers
use parent 'WWW::GoKGS::Scraper'; use URI; use Web::Scraper; sub _build_base_uri { URI->new('http://www.gokgs.com/...'); } sub _build_scraper { my $self = shift; scraper { ... }; }
This module is an abstract base class for KGS scrapers. KGS scrapers must inherit from this class, and also implement two methods; _build_base_uri and _build_scraper. _build_base_uri must return a URI object which represents a resource on KGS. _build_scraper must return an Web::Scraper object which can scrape the resource. Both of them are called as a method on the object with no parameters.
_build_base_uri
_build_scraper
scrape
Returns a URI object which represents a resource on KGS. This attribute is read-only.
Can be used to get or set an LWP::UserAgent object which is used to GET the requested resource. Defaults to the LWP::UserAgent object shared by Web::Scraper users ($Web::Scraper::UserAgent).
GET
LWP::UserAgent
$Web::Scraper::UserAgent
Returns all the filters associated with $key.
$key
Pushes $filter onto the filter stack specified by $key. You can also push multiple filters in one add_filter call. $filter can be either a filter class name or a subref. See Web::Scraper::Filter for details.
$filter
add_filter
Executes all the filters associated with $key on $value.
$value
Given arguments are passed to the scrape method of an Web::Scraper object built by the _build_scraper method.
Given key-value pairs of query parameters, constructs a URI object which consists of base_uri and the query parameters, then pass the URI to the scrape method.
base_uri
URI
WWW::GoKGS
Ryo Anazawa (anazawa@cpan.org)
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
To install WWW::GoKGS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::GoKGS
CPAN shell
perl -MCPAN -e shell install WWW::GoKGS
For more information on module installation, please visit the detailed CPAN module installation guide.