++ed by:

1 non-PAUSE user(s).

Ron Savage

NAME

WWW::Scraper::Wikipedia::ISO3166::Database::Export - Export www.scraper.wikipedia.iso3166.sqlite as CSV and HTML

Synopsis

See "Synopsis" in WWW::Scraper::Wikipedia::ISO3166.

Description

Documents the methods end-users need to export the SQLite database, www.scraper.wikipedia.iso3166.sqlite, which ships with this distro, as either CSV or HTML.

See scripts/export.as.csv.pl and scripts/export.as.html.pl.

The input to these scripts is shipped as share/www.scraper.wikipedia.iso3166.sqlite.

The output of these scripts is shipped as:

o data/countries.csv
o data/iso.3166-2.html

This file is on-line at: http://savage.net.au/Perl-modules/html/WWW/Scraper/Wikipedia/ISO3166/iso.3166-2.html.

o data/subcountries.csv

Distributions

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.

Constructor and initialization

new(...) returns an object of type WWW::Scraper::Wikipedia::ISO3166::Database::Export.

This is the class's contructor.

Usage: WWW::Scraper::Wikipedia::ISO3166::Database::Export -> new().

This method takes a hash of options.

Call new() as new(option_1 => value_1, option_2 => value_2, ...).

Available options (these are also methods):

o country_file => $a_csv_file_name

Specify the name of the CSV file to which country data is exported.

Default: 'countries.csv'.

o subcountry_file => $a_csv_file_name

Specify the name of the CSV file to which subcountry data is exported.

Default: 'subcountries.csv'.

o web_page_file => $a_html_file_name

Specify the name of the HTML file to which country and subcountry data is exported.

See htdocs/assets/templates/www/scraper/wikipedia/iso3166/iso3166.report.tx for the web page template used.

*.tx files are processed with Text::Xslate.

Default: 'iso.3166-2.html'.

Methods

This module is a sub-class of WWW::Scraper::Wikipedia::ISO3166::Database and consequently inherits its methods.

as_csv()

Export the SQLite database to 2 CSV files.

as_html()

Export the SQLite database to 1 HTML file.

build_country_data()

Builds part of a HTML table, and returns an arrayref of arrayrefs of hashrefs suitable for Text::Xslate.

country_file($file_name)

Get or set the name of the CSV file to which country data is exported.

Also, country_file is an option to "new()".

new()

See "Constructor and initialization".

subcountry_file($file_name)

Get or set the name of the CSV file to which subcountry data is exported.

Also, subcountry_file is an option to "new()".

web_page_file($file_name)

Get or set the name of the HTML file to which country and subcountry data is exported.

Also, web_page_file is an option to "new()".

FAQ

For the database schema, etc, see "FAQ" in WWW::Scraper::Wikipedia::ISO3166.

References

See "References" in WWW::Scraper::Wikipedia::ISO3166.

Support

Email the author, or log a bug on RT:

https://rt.cpan.org/Public/Dist/Display.html?Name=WWW::Scraper::Wikipedia::ISO3166.

Author

WWW::Scraper::Wikipedia::ISO3166 was written by Ron Savage <ron@savage.net.au> in 2012.

Home page: http://savage.net.au/index.html.

Copyright

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



Hosting generously
sponsored by Bytemark