The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WebService::Recruit::CarSensor::Catalog - CarSensor.net Web Service "catalog" API

SYNOPSIS

    use WebService::Recruit::CarSensor;
    
    my $service = WebService::Recruit::CarSensor->new();
    
    my $param = {
        'country' => 'JPN',
        'key' => $ENV{'WEBSERVICE_RECRUIT_KEY'},
    };
    my $res = $service->catalog( %$param );
    my $data = $res->root;
    print "api_version: $data->api_version\n";
    print "results_available: $data->results_available\n";
    print "results_returned: $data->results_returned\n";
    print "results_start: $data->results_start\n";
    print "catalog: $data->catalog\n";
    print "...\n";

DESCRIPTION

This module is a interface for the catalog API. It accepts following query parameters to make an request.

    my $param = {
        'key' => 'XXXXXXXX',
        'brand' => 'SB',
        'model' => 'インプレッサ',
        'country' => 'JPN',
        'body' => 'S',
        'person' => '5',
        'year_old' => '1998',
        'year_new' => '1998',
        'welfare' => '1',
        'series' => 'GF-GF8',
        'keyword' => 'XXXXXXXX',
        'width_max' => '1700',
        'height_max' => '1500',
        'length_max' => '4500',
        'order' => '1',
        'start' => '1',
        'count' => '30',
    };
    my $res = $service->catalog( %$param );

$service above is an instance of WebService::Recruit::CarSensor.

METHODS

root

This returns the root element of the response.

    my $root = $res->root;

You can retrieve each element by the following accessors.

    $root->api_version
    $root->results_available
    $root->results_returned
    $root->results_start
    $root->catalog
    $root->catalog->[0]->brand
    $root->catalog->[0]->model
    $root->catalog->[0]->grade
    $root->catalog->[0]->price
    $root->catalog->[0]->desc
    $root->catalog->[0]->body
    $root->catalog->[0]->person
    $root->catalog->[0]->period
    $root->catalog->[0]->series
    $root->catalog->[0]->width
    $root->catalog->[0]->height
    $root->catalog->[0]->length
    $root->catalog->[0]->photo
    $root->catalog->[0]->urls
    $root->catalog->[0]->desc
    $root->catalog->[0]->brand->code
    $root->catalog->[0]->brand->name
    $root->catalog->[0]->body->code
    $root->catalog->[0]->body->name
    $root->catalog->[0]->photo->front
    $root->catalog->[0]->photo->rear
    $root->catalog->[0]->photo->inpane
    $root->catalog->[0]->urls->pc
    $root->catalog->[0]->urls->mobile
    $root->catalog->[0]->urls->qr
    $root->catalog->[0]->photo->front->caption
    $root->catalog->[0]->photo->front->l
    $root->catalog->[0]->photo->front->s
    $root->catalog->[0]->photo->rear->caption
    $root->catalog->[0]->photo->rear->l
    $root->catalog->[0]->photo->rear->s
    $root->catalog->[0]->photo->inpane->caption
    $root->catalog->[0]->photo->inpane->l
    $root->catalog->[0]->photo->inpane->s

xml

This returns the raw response context itself.

    print $res->xml, "\n";

code

This returns the response status code.

    my $code = $res->code; # usually "200" when succeeded

is_error

This returns true value when the response has an error.

    die 'error!' if $res->is_error;

SEE ALSO

WebService::Recruit::CarSensor

AUTHOR

RECRUIT Media Technology Labs <mtl@cpan.org>

COPYRIGHT

Copyright 2008 RECRUIT Media Technology Labs

1 POD Error

The following errors were encountered while parsing the POD:

Around line 93:

Non-ASCII character seen before =encoding in ''インプレッサ','. Assuming CP1252