WebService::Recruit::Jalan - A Interface for Jalan Web Service
use WebService::Recruit::Jalan; my $jalan = WebService::Recruit::Jalan->new(); $jalan->key( 'xxxxxxxxxxxxxx' ); my $res = $jalan->HotelSearchAdvance( s_area => '260502' ); my $list = $res->root->Hotel; foreach my $hotel ( @$list ) { print "HotelID: ", $hotel->HotelID, "\n"; print "HotelName: ", $hotel->HotelName, "\n"; }
This module is a interface for the Jalan Web Service, provided by Recruit Co., Ltd., Japan. It provides five API methods: "HotelSearchLite", "HotelSearchAdvance", "AreaSearch", "OnsenSearch" and "StockSearch".
See WebService::Recruit::Jalan::SearchPOI for details.
my $res = $doko->HotelSearchLite( s_area => '162612' );
See WebService::Recruit::Jalan::GetLandmark for details.
my $res = $doko->HotelSearchAdvance( s_area => '260502' );
See WebService::Recruit::Jalan::AreaSearch for details.
my $res = $doko->AreaSearch( reg => 15 );
See WebService::Recruit::Jalan::OnsenSearch for details.
my $res = $doko->OnsenSearch( s_area => '141602' );
See WebService::Recruit::Jalan::StockSearch for details.
my $res = $doko->StockSearch( lon_jgd => 139.758, lat_jgd => 35.666 );
Each API response also provides paging methods following:
page method returns a Data::Page instance.
page
my $page = $res->page(); print "Total: ", $page->total_entries, "\n"; print "Page: ", $page->current_page, "\n"; print "Last: ", $page->last_page, "\n";
pageset method returns a Data::Pageset instance
pageset
my $pageset = $res->pageset( 'fixed' ); $pageset->pages_per_set($pages_per_set); my $set = $pageset->pages_in_set(); foreach my $num ( @$set ) { print "$num "; }
page_param method returns a hash to specify the page for the next request.
page_param
my %hash = $res->page_param( $page->next_page );
page_query method returns a query string to specify the page for the next request.
page_query
my $query = $res->page_query( $page->prev_page );
This modules uses XML::TreePP module internally. Following methods are available to configure it.
my $doko = WebService::Recruit::Jalan->new(); $doko->utf8_flag( 1 ); $doko->user_agent( 'Foo-Bar/1.0 ' ); $doko->lwp_useragent( LWP::UserAgent->new() ); $doko->http_lite( HTTP::Lite->new() );
http://jws.jalan.net/
Yusuke Kawasaki http://www.kawa.net/
This module is unofficial and released by the authour in person.
Copyright (c) 2007 Yusuke Kawasaki. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install WebService::Recruit::Jalan, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Recruit::Jalan
CPAN shell
perl -MCPAN -e shell install WebService::Recruit::Jalan
For more information on module installation, please visit the detailed CPAN module installation guide.