WebService::Recruit::CarSensor::Catalog - CarSensor.net Web Service "catalog" API
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";
This module is a interface for the catalog API. It accepts following query parameters to make an request.
catalog
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.
$service
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
This returns the raw response context itself.
print $res->xml, "\n";
This returns the response status code.
my $code = $res->code; # usually "200" when succeeded
This returns true value when the response has an error.
die 'error!' if $res->is_error;
WebService::Recruit::CarSensor
RECRUIT Media Technology Labs <mtl@cpan.org>
Copyright 2008 RECRUIT Media Technology Labs
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in ''インプレッサ','. Assuming CP1252
To install WebService::Recruit::CarSensor, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Recruit::CarSensor
CPAN shell
perl -MCPAN -e shell install WebService::Recruit::CarSensor
For more information on module installation, please visit the detailed CPAN module installation guide.