NAME

WebService::Recruit::CarSensor::Usedcar - CarSensor.net Web Service "usedcar" API

SYNOPSIS

use WebService::Recruit::CarSensor;

my $service = WebService::Recruit::CarSensor->new();

my $param = {
    'key' => $ENV{'WEBSERVICE_RECRUIT_KEY'},
    'pref' => '13',
};
my $res = $service->usedcar( %$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 "usedcar: $data->usedcar\n";
print "...\n";

DESCRIPTION

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

my $param = {
    'key' => 'XXXXXXXX',
    'id' => 'CH9999999999',
    'brand' => 'SB',
    'model' => 'インプレッサ',
    'country' => 'JPN',
    'large_area' => '1',
    'pref' => '13',
    'body' => 'S',
    'person' => '5',
    'color' => 'WT',
    'price_min' => '500000',
    'price_max' => '500000',
    'keyword' => 'XXXXXXXX',
    'lat' => '35.669220',
    'lng' => '139.761457',
    'range' => '100',
    'datum' => 'world',
    'mission' => '1',
    'nonsmoking' => '1',
    'leather' => '1',
    'welfare' => '1',
    'year_old' => '1998',
    'year_new' => '1998',
    'odd_min' => '50000',
    'odd_max' => '50000',
    'order' => '1',
    'start' => '1',
    'count' => '10',
};
my $res = $service->usedcar( %$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->usedcar
$root->usedcar->[0]->id
$root->usedcar->[0]->brand
$root->usedcar->[0]->model
$root->usedcar->[0]->grade
$root->usedcar->[0]->price
$root->usedcar->[0]->desc
$root->usedcar->[0]->body
$root->usedcar->[0]->odd
$root->usedcar->[0]->year
$root->usedcar->[0]->shop
$root->usedcar->[0]->color
$root->usedcar->[0]->photo
$root->usedcar->[0]->urls
$root->usedcar->[0]->brand->code
$root->usedcar->[0]->brand->name
$root->usedcar->[0]->body->code
$root->usedcar->[0]->body->name
$root->usedcar->[0]->shop->name
$root->usedcar->[0]->shop->pref
$root->usedcar->[0]->shop->lat
$root->usedcar->[0]->shop->lng
$root->usedcar->[0]->shop->datum
$root->usedcar->[0]->photo->main
$root->usedcar->[0]->photo->sub
$root->usedcar->[0]->urls->pc
$root->usedcar->[0]->urls->mobile
$root->usedcar->[0]->urls->qr
$root->usedcar->[0]->shop->pref->code
$root->usedcar->[0]->shop->pref->name
$root->usedcar->[0]->photo->main->l
$root->usedcar->[0]->photo->main->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 94:

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