WebService::Recruit::AbRoad::TourTally - AB-ROAD Web Service "tour_tally" API
use WebService::Recruit::AbRoad; my $service = WebService::Recruit::AbRoad->new(); my $param = { 'key' => $ENV{'WEBSERVICE_RECRUIT_KEY'}, 'keyword' => '登山', }; my $res = $service->tour_tally( %$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_tally: $data->tour_tally\n"; print "...\n";
This module is a interface for the tour_tally API. It accepts following query parameters to make an request.
tour_tally
my $param = { 'key' => 'XXXXXXXX', 'keyword' => '登山', 'dept' => 'XXXXXXXX', 'ym' => 'XXXXXXXX', 'ymd' => 'XXXXXXXX', 'price_min' => 'XXXXXXXX', 'price_max' => 'XXXXXXXX', 'term_min' => 'XXXXXXXX', 'term_max' => 'XXXXXXXX', 'airline' => 'XXXXXXXX', 'kodaw' => 'XXXXXXXX', 'axis' => 'XXXXXXXX', 'order' => 'XXXXXXXX', 'start' => 'XXXXXXXX', 'count' => 'XXXXXXXX', }; my $res = $service->tour_tally( %$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_tally $root->tour_tally->[0]->type $root->tour_tally->[0]->code $root->tour_tally->[0]->name $root->tour_tally->[0]->tour_count $root->tour_tally->[0]->lat $root->tour_tally->[0]->lng $root->tour_tally->[0]->area $root->tour_tally->[0]->country $root->tour_tally->[0]->area->code $root->tour_tally->[0]->area->name $root->tour_tally->[0]->country->code $root->tour_tally->[0]->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 CP1252
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.