WWW::GoKGS::Scraper - Abstract base class for KGS scrapers
use parent 'WWW::GoKGS::Scraper'; use Web::Scraper; sub base_uri { '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 the following methods:
Must return a URI string which represents a resource on KGS. This method is called as a method on the class.
Must return an Web::Scraper object which can scrape the resource. This method is called as a method on the object.
scrape
Given key-value pairs of query parameters, constructs a URI object which consists of base_uri and the paramters.
base_uri
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
Given arguments are passed to the scrape method of an Web::Scraper object built by the _build_scraper method.
_build_scraper
Given key-value pairs of query parameters, constructs a URI object which consists of base_uri and the parameters, then pass the URI to the scrape method.
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.