WWW::Scraper::Request::ZIPplus4 - Canonical form for Scraper::ZIPplus4 requests


Scraper documentation Contained in the Scraper distribution.

Index


Code Index:

NAME

Top

WWW::Scraper::Request::ZIPplus4 - Canonical form for Scraper::ZIPplus4 requests

SYNOPSIS

Top

    use WWW::Scraper::Request::ZIPplus4;

    $rqst = new WWW::Scraper::Request::ZIPplus4;
    $rqst->DeliveryAddress('1600 Pennsylvania Ave');
    $rqst->City('Washington');
    $rqst->State('DC');

DESCRIPTION

Top

This module provides a canonical taxonomy for specifying requests to search engines (via Scraper modules). Request::ZIPplus4 is targeted toward zip+4 validations.

See the WWW::Scraper::Request module for a description of how this interfaces with Scraper modules.

SPECIAL THANKS

Top

To Klemens Schmid (klemens.schmid@gmx.de), for FormSniffer.

This tool is an excellent compliment to Scraper to almost instantly discover form and CGI parameters for configuring new Scraper modules. It instantly revealed what I was doing wrong in the new ZIPplus4 format one day (after hours of my own clumsy attempts). See FormSniffer at http://www.wap2web.de/formsniffer2.aspx (Win32 only).

AUTHOR

Top

WWW::Scraper::Request is written and maintained by Glenn Wood, http://search.cpan.org/search?mode=author&query=GLENNWOOD.

COPYRIGHT

Top


Scraper documentation Contained in the Scraper distribution.

package WWW::Scraper::Request::ZIPplus4;

use strict;

use vars qw($VERSION @ISA);
$VERSION = sprintf("%d.%02d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/);

use WWW::Scraper::Request;
use base qw( WWW::Scraper::Request );

sub new {
    my $self = WWW::Scraper::Request::new(
         'ZIPplus4'
        ,{
             'Firm' => ''
            ,'Urbanization' => ''
            ,'DeliveryAddress' => '' # required
            ,'address2' => '' # optional
            ,'City' => ''     # required unless Zip is provided
            ,'State' => ''    # required unless Zip is provided
            ,'ZipCode' => ''  # recommended, else City and State are required
         }
        ,@_);
    return $self;
}

sub GetFieldNames {
    return {
             'Firm' => 'Firm'
            ,'Urbanization' => 'Urbanization'
            ,'DeliveryAddress' => 'Delivery Address'
            ,'City' => 'City'
            ,'State' => 'State'
            ,'ZipCode' => 'Zip Code'
           }
}
sub FieldTitles {
    return {
             'Firm' => 'Firm'
            ,'Urbanization' => 'Urbanization'
            ,'DeliveryAddress' => 'Delivery Address'
            ,'City' => 'City'
            ,'State' => 'State'
            ,'Zip_Code' => 'Zip Code'
           }
}


1;

__END__