WWW::Scraper::Wikipedia::ISO3166::Database::Import - Part of the interface to www.scraper.wikipedia.iso3166.sqlite
See "Synopsis" in WWW::Scraper::Wikipedia::ISO3166.
Documents the methods used to populate the SQLite database, www.scraper.wikipedia.iso3166.sqlite, which ships with this distro.
See "Description" in WWW::Scraper::Wikipedia::ISO3166 for a long description.
This module is available as a Unix-style distro (*.tgz).
See http://savage.net.au/Perl-modules.html for details.
See http://savage.net.au/Perl-modules/html/installing-a-module.html for help on unpacking and installing.
new(...) returns an object of type WWW::Scraper::Wikipedia::ISO3166::Database::Import.
WWW::Scraper::Wikipedia::ISO3166::Database::Import
This is the class's contructor.
Usage: WWW::Scraper::Wikipedia::ISO3166::Database::Import -> new().
WWW::Scraper::Wikipedia::ISO3166::Database::Import -> new()
This method takes a hash of options.
Call new() as new(option_1 => value_1, option_2 => value_2, ...).
new()
new(option_1 => value_1, option_2 => value_2, ...)
Available options (these are also methods):
Specifies the code2 of the country whose subcountry page is to be downloaded.
This module is a sub-class of WWW::Scraper::Wikipedia::ISO3166::Database and consequently inherits its methods.
Get or set the 2-letter country code of the country or subcountry being processed.
Also, code2 is an option to "new()".
Extract, recursively if necessary, the content of the HTML element, as returned from HTML::TreeBuilder's look_down() method.
Get the country or subcountry details from the HTML table ($node), as returned from HTML::TreeBuilder's look_down() method.
Use the arrayref $column_type of HTML attributes ('a', 'tt', '-', i.e. none) to determine exactly how to extract the data from the enclosing 'td'.
Use $country_code to handle some special cases, specifically:
Returns an arrayref of hashrefs, where the (key => value) pair of each hashref are:
The country or subcountry code.
An indicator as to whether or not the country has subcountries.
The name of the country or subcountry.
See "Constructor and initialization".
Parse the HTML page of 3-letter country codes, which has 3 tables side-by-side.
Return an arrayref of 3-letter codes.
Special cases are documented in "What is the database schema?" in WWW::Scraper::Wikipedia::ISO3166.
Parse the HTML page of country names.
Returns the result of calling "get_table($node, $column_type, $country_code)".
Parse the HTML page of a subcountry.
Warning. The 2-letter code of the subcountry must be set with $self -> code2('XX') before calling this method.
Populate the countries table.
Populate the subcountries table, for 1 subcountry.
Populate the subcountries table, for all subcountries.
Clean up the detail key of the arrayref of hashrefs for the countries.
Delete the detail key of the arrayref of hashrefs for the subcountry.
Save the countries table, by combining the output of parse_country_code_page() with the output of "process_countries($table)".
Save the subcountries table, for the given subcountry, using the output of "process_subcountries($table)".
$count is just used in the log for progress messages.
Remove leading and trailing spaces from $s, and return it.
For the database schema, etc, see "FAQ" in WWW::Scraper::Wikipedia::ISO3166.
See "References" in WWW::Scraper::Wikipedia::ISO3166.
Email the author, or log a bug on RT:
https://rt.cpan.org/Public/Dist/Display.html?Name=WWW::Scraper::Wikipedia::ISO3166.
WWW::Scraper::Wikipedia::ISO3166 was written by Ron Savage <ron@savage.net.au> in 2012.
WWW::Scraper::Wikipedia::ISO3166
Home page: http://savage.net.au/index.html.
Australian copyright (c) 2012 Ron Savage.
All Programs of mine are 'OSI Certified Open Source Software'; you can redistribute them and/or modify them under the terms of The Artistic License, a copy of which is available at: http://www.opensource.org/licenses/index.html
To install WWW::Scraper::Wikipedia::ISO3166, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Scraper::Wikipedia::ISO3166
CPAN shell
perl -MCPAN -e shell install WWW::Scraper::Wikipedia::ISO3166
For more information on module installation, please visit the detailed CPAN module installation guide.