WebService::Recruit::AbRoad::Tour - AB-ROAD Web Service "tour" API
use WebService::Recruit::AbRoad; my $service = WebService::Recruit::AbRoad->new(); my $param = { 'area' => 'EUR', 'key' => $ENV{'WEBSERVICE_RECRUIT_KEY'}, }; my $res = $service->tour( %$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 "tour: $data->tour\n"; print "...\n";
This module is a interface for the tour API. It accepts following query parameters to make an request.
tour
my $param = { 'key' => 'XXXXXXXX', 'id' => 'AB123456', 'area' => 'EUR', 'country' => 'BE', 'city' => 'NYC', 'hotel' => '73393', 'keyword' => 'ベトナム 癒し', 'dept' => 'XXXXXXXX', 'ym' => '0708', 'ymd' => '070812', 'price_min' => '30000', 'price_max' => '100000', 'term_min' => '3', 'term_max' => '10', 'airline' => 'A0', 'kodaw' => 'XXXXXXXX', 'order' => 'XXXXXXXX', 'start' => 'XXXXXXXX', 'count' => 'XXXXXXXX', }; my $res = $service->tour( %$param );
$service above is an instance of WebService::Recruit::AbRoad.
$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->tour $root->tour->[0]->id $root->tour->[0]->last_update $root->tour->[0]->term $root->tour->[0]->title $root->tour->[0]->airline $root->tour->[0]->airline_summary $root->tour->[0]->brand $root->tour->[0]->city_summary $root->tour->[0]->dept_city $root->tour->[0]->hotel $root->tour->[0]->hotel_summary $root->tour->[0]->kodawari $root->tour->[0]->price $root->tour->[0]->sche $root->tour->[0]->urls $root->tour->[0]->airline->[0]->code $root->tour->[0]->airline->[0]->name $root->tour->[0]->brand->code $root->tour->[0]->brand->name $root->tour->[0]->dept_city->name $root->tour->[0]->dept_city->code $root->tour->[0]->hotel->[0]->code $root->tour->[0]->hotel->[0]->name $root->tour->[0]->hotel->[0]->city $root->tour->[0]->kodawari->[0]->code $root->tour->[0]->kodawari->[0]->name $root->tour->[0]->price->all_month $root->tour->[0]->price->min $root->tour->[0]->price->max $root->tour->[0]->sche->[0]->day $root->tour->[0]->sche->[0]->city $root->tour->[0]->urls->mobile $root->tour->[0]->urls->pc $root->tour->[0]->urls->qr $root->tour->[0]->hotel->[0]->city->code $root->tour->[0]->hotel->[0]->city->name $root->tour->[0]->price->all_month->min $root->tour->[0]->price->all_month->max $root->tour->[0]->sche->[0]->city->code $root->tour->[0]->sche->[0]->city->name $root->tour->[0]->sche->[0]->city->lat $root->tour->[0]->sche->[0]->city->lng $root->tour->[0]->sche->[0]->city->area $root->tour->[0]->sche->[0]->city->country $root->tour->[0]->sche->[0]->city->area->code $root->tour->[0]->sche->[0]->city->area->name $root->tour->[0]->sche->[0]->city->country->code $root->tour->[0]->sche->[0]->city->country->name
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::AbRoad
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 UTF-8
To install WebService::Recruit::AbRoad, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Recruit::AbRoad
CPAN shell
perl -MCPAN -e shell install WebService::Recruit::AbRoad
For more information on module installation, please visit the detailed CPAN module installation guide.