| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package WebService::Recruit::Jalan::HotelSearchLite; |
|
2
|
3
|
|
|
3
|
|
17
|
use strict; |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
113
|
|
|
3
|
3
|
|
|
3
|
|
16
|
use vars qw( $VERSION ); |
|
|
3
|
|
|
|
|
10
|
|
|
|
3
|
|
|
|
|
183
|
|
|
4
|
3
|
|
|
3
|
|
18
|
use base qw( WebService::Recruit::Jalan::Base ); |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
1860
|
|
|
5
|
|
|
|
|
|
|
$VERSION = '0.10'; |
|
6
|
|
|
|
|
|
|
|
|
7
|
0
|
|
|
0
|
1
|
0
|
sub url { 'http://jws.jalan.net/APILite/HotelSearch/V1/'; } |
|
8
|
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
1
|
1033
|
sub query_class { 'WebService::Recruit::Jalan::HotelSearchLite::Query'; } |
|
10
|
3
|
|
|
3
|
0
|
58
|
sub query_fields { [qw( |
|
11
|
|
|
|
|
|
|
key pref l_area s_area h_id h_type o_pool parking pub_bath onsen |
|
12
|
|
|
|
|
|
|
prv_bath v_bath sauna jacz mssg r_ski r_brd pet esthe p_pong limo |
|
13
|
|
|
|
|
|
|
late_out pict_size order start count |
|
14
|
|
|
|
|
|
|
)]; } |
|
15
|
0
|
|
|
0
|
1
|
0
|
sub notnull_param { [qw( key )]; } |
|
16
|
|
|
|
|
|
|
|
|
17
|
0
|
|
|
0
|
1
|
0
|
sub elem_class { 'WebService::Recruit::Jalan::HotelSearchLite::Element'; } |
|
18
|
3
|
|
|
3
|
1
|
46
|
sub root_elem { 'Results'; } |
|
19
|
|
|
|
|
|
|
sub elem_fields { { |
|
20
|
3
|
|
|
3
|
0
|
122
|
Results => [qw( |
|
21
|
|
|
|
|
|
|
NumberOfResults DisplayPerPage DisplayFrom APIVersion Hotel |
|
22
|
|
|
|
|
|
|
)], |
|
23
|
|
|
|
|
|
|
Hotel => [qw( |
|
24
|
|
|
|
|
|
|
HotelID HotelName PostCode HotelAddress Area HotelType |
|
25
|
|
|
|
|
|
|
HotelDetailURL HotelCatchCopy HotelCaption PictureURL |
|
26
|
|
|
|
|
|
|
PictureCaption AccessInformation CheckInTime CheckOutTime |
|
27
|
|
|
|
|
|
|
X Y LastUpdate |
|
28
|
|
|
|
|
|
|
)], |
|
29
|
|
|
|
|
|
|
Area => [qw( |
|
30
|
|
|
|
|
|
|
Region Prefecture LargeArea SmallArea |
|
31
|
|
|
|
|
|
|
)], |
|
32
|
|
|
|
|
|
|
AccessInformation => [qw( |
|
33
|
|
|
|
|
|
|
name _text |
|
34
|
|
|
|
|
|
|
)], |
|
35
|
|
|
|
|
|
|
LastUpdate => [qw( |
|
36
|
|
|
|
|
|
|
day month year |
|
37
|
|
|
|
|
|
|
)], |
|
38
|
|
|
|
|
|
|
}; } |
|
39
|
0
|
|
|
0
|
1
|
|
sub force_array { [qw( Hotel AccessInformation )]; } |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# __PACKAGE__->mk_query_accessors(); |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
@WebService::Recruit::Jalan::HotelSearchLite::Query::ISA = qw( Class::Accessor::Fast ); |
|
44
|
|
|
|
|
|
|
WebService::Recruit::Jalan::HotelSearchLite::Query->mk_accessors( @{query_fields()} ); |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# __PACKAGE__->mk_elem_accessors(); |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
@WebService::Recruit::Jalan::HotelSearchLite::Element::ISA = qw( Class::Accessor::Children::Fast ); |
|
49
|
|
|
|
|
|
|
WebService::Recruit::Jalan::HotelSearchLite::Element->mk_ro_accessors( root_elem() ); |
|
50
|
|
|
|
|
|
|
WebService::Recruit::Jalan::HotelSearchLite::Element->mk_child_ro_accessors( %{elem_fields()} ); |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 NAME |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
WebService::Recruit::Jalan::HotelSearchLite - Jalan Web Service "HotelSearchLite" API |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
use WebService::Recruit::Jalan; |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
my $jalan = WebService::Recruit::Jalan->new(); |
|
61
|
|
|
|
|
|
|
$jalan->key( 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' ); |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
my $param = { |
|
64
|
|
|
|
|
|
|
s_area => '162612', |
|
65
|
|
|
|
|
|
|
h_type => '1', |
|
66
|
|
|
|
|
|
|
}; |
|
67
|
|
|
|
|
|
|
my $res = $jalan->HotelSearchLite( %$param ); |
|
68
|
|
|
|
|
|
|
die "error!" if $res->is_error; |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
my $list = $res->root->Hotel; |
|
71
|
|
|
|
|
|
|
foreach my $hotel ( @$list ) { |
|
72
|
|
|
|
|
|
|
print "HotelID: ", $hotel->HotelID, "\n"; |
|
73
|
|
|
|
|
|
|
print "HotelName: ", $hotel->HotelName, "\n"; |
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
This module is a interface for the C API. |
|
79
|
|
|
|
|
|
|
It accepts following query parameters to make an request. |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
my $param = { |
|
82
|
|
|
|
|
|
|
pref => '130000', |
|
83
|
|
|
|
|
|
|
l_area => '136200', |
|
84
|
|
|
|
|
|
|
s_area => '136202', |
|
85
|
|
|
|
|
|
|
h_id => '324994', |
|
86
|
|
|
|
|
|
|
h_type => '0', |
|
87
|
|
|
|
|
|
|
o_pool => '0', |
|
88
|
|
|
|
|
|
|
parking => '0', |
|
89
|
|
|
|
|
|
|
pub_bath => '0', |
|
90
|
|
|
|
|
|
|
onsen => '0', |
|
91
|
|
|
|
|
|
|
prv_bath => '0', |
|
92
|
|
|
|
|
|
|
v_bath => '0', |
|
93
|
|
|
|
|
|
|
sauna => '0', |
|
94
|
|
|
|
|
|
|
jacz => '0', |
|
95
|
|
|
|
|
|
|
mssg => '0', |
|
96
|
|
|
|
|
|
|
r_ski => '0', |
|
97
|
|
|
|
|
|
|
r_brd => '0', |
|
98
|
|
|
|
|
|
|
pet => '0', |
|
99
|
|
|
|
|
|
|
esthe => '0', |
|
100
|
|
|
|
|
|
|
p_pong => '0', |
|
101
|
|
|
|
|
|
|
limo => '0', |
|
102
|
|
|
|
|
|
|
late_out => '0', |
|
103
|
|
|
|
|
|
|
pict_size => '3', # pictM |
|
104
|
|
|
|
|
|
|
order => '0', |
|
105
|
|
|
|
|
|
|
start => '1', |
|
106
|
|
|
|
|
|
|
count => '10', |
|
107
|
|
|
|
|
|
|
}; |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
C<$jalan> above is an instance of L. |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 METHODS |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head2 root |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
This returns the root element of the response. |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
my $root = $res->root; |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
You can retrieve each element by the following accessors. |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
$root->NumberOfResults; |
|
122
|
|
|
|
|
|
|
$root->DisplayPerPage; |
|
123
|
|
|
|
|
|
|
$root->DisplayFrom; |
|
124
|
|
|
|
|
|
|
$root->APIVersion; |
|
125
|
|
|
|
|
|
|
$root->Hotel; |
|
126
|
|
|
|
|
|
|
$root->Hotel->[0]->HotelID; |
|
127
|
|
|
|
|
|
|
$root->Hotel->[0]->HotelName; |
|
128
|
|
|
|
|
|
|
$root->Hotel->[0]->PostCode; |
|
129
|
|
|
|
|
|
|
$root->Hotel->[0]->HotelAddress; |
|
130
|
|
|
|
|
|
|
$root->Hotel->[0]->Area; |
|
131
|
|
|
|
|
|
|
$root->Hotel->[0]->Area->Region; |
|
132
|
|
|
|
|
|
|
$root->Hotel->[0]->Area->Prefecture; |
|
133
|
|
|
|
|
|
|
$root->Hotel->[0]->Area->LargeArea; |
|
134
|
|
|
|
|
|
|
$root->Hotel->[0]->Area->SmallArea; |
|
135
|
|
|
|
|
|
|
$root->Hotel->[0]->HotelType; |
|
136
|
|
|
|
|
|
|
$root->Hotel->[0]->HotelDetailURL; |
|
137
|
|
|
|
|
|
|
$root->Hotel->[0]->HotelCatchCopy; |
|
138
|
|
|
|
|
|
|
$root->Hotel->[0]->HotelCaption; |
|
139
|
|
|
|
|
|
|
$root->Hotel->[0]->PictureURL; |
|
140
|
|
|
|
|
|
|
$root->Hotel->[0]->PictureCaption; |
|
141
|
|
|
|
|
|
|
$root->Hotel->[0]->AccessInformation; |
|
142
|
|
|
|
|
|
|
$root->Hotel->[0]->AccessInformation->[0]->name; |
|
143
|
|
|
|
|
|
|
$root->Hotel->[0]->CheckInTime; |
|
144
|
|
|
|
|
|
|
$root->Hotel->[0]->CheckOutTime; |
|
145
|
|
|
|
|
|
|
$root->Hotel->[0]->X; |
|
146
|
|
|
|
|
|
|
$root->Hotel->[0]->Y; |
|
147
|
|
|
|
|
|
|
$root->Hotel->[0]->LastUpdate; |
|
148
|
|
|
|
|
|
|
$root->Hotel->[0]->LastUpdate->day; |
|
149
|
|
|
|
|
|
|
$root->Hotel->[0]->LastUpdate->month; |
|
150
|
|
|
|
|
|
|
$root->Hotel->[0]->LastUpdate->year; |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head2 xml |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
This returns the raw response context itself. |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
print $res->xml, "\n"; |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=head2 code |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
This returns the response status code. |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
my $code = $res->code; # usually "200" when succeeded |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=head2 is_error |
|
165
|
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
This returns true value when the response has an error. |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
die 'error!' if $res->is_error; |
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=head2 page |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
This returns a L instance. |
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
my $page = $res->page(); |
|
175
|
|
|
|
|
|
|
print "Total: ", $page->total_entries, "\n"; |
|
176
|
|
|
|
|
|
|
print "Page: ", $page->current_page, "\n"; |
|
177
|
|
|
|
|
|
|
print "Last: ", $page->last_page, "\n"; |
|
178
|
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=head2 pageset |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
This returns a L instance. |
|
182
|
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
my $pageset = $res->pageset( 'fixed' ); |
|
184
|
|
|
|
|
|
|
$pageset->pages_per_set($pages_per_set); |
|
185
|
|
|
|
|
|
|
my $set = $pageset->pages_in_set(); |
|
186
|
|
|
|
|
|
|
foreach my $num ( @$set ) { |
|
187
|
|
|
|
|
|
|
print "$num "; |
|
188
|
|
|
|
|
|
|
} |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=head2 page_param |
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
This returns a hash to specify the page for the next request. |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
my %hash = $res->page_param( $page->next_page ); |
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=head2 page_query |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
This returns a query string to specify the page for the next request. |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
my $query = $res->page_query( $page->prev_page ); |
|
201
|
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
L |
|
205
|
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=head1 AUTHOR |
|
207
|
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
Yusuke Kawasaki L |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
This module is unofficial and released by the author in person. |
|
211
|
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
213
|
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
Copyright (c) 2007 Yusuke Kawasaki. All rights reserved. |
|
215
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or |
|
216
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. |
|
217
|
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=cut |
|
219
|
|
|
|
|
|
|
1; |