line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::Recruit::Akasugu::Item; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
748
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
95
|
|
4
|
3
|
|
|
3
|
|
14
|
use base qw( WebService::Recruit::Akasugu::Base ); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
1575
|
|
5
|
3
|
|
|
3
|
|
16
|
use vars qw( $VERSION ); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
94
|
|
6
|
3
|
|
|
3
|
|
15
|
use Class::Accessor::Fast; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
24
|
|
7
|
3
|
|
|
3
|
|
72
|
use Class::Accessor::Children::Fast; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
11
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$VERSION = '0.0.1'; |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
0
|
1
|
0
|
sub http_method { 'GET'; } |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
0
|
1
|
0
|
sub url { 'http://webservice.recruit.co.jp/akasugu/item/v1/'; } |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
1
|
38
|
sub query_class { 'WebService::Recruit::Akasugu::Item::Query'; } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub query_fields { [ |
18
|
3
|
|
|
3
|
0
|
38
|
'key', 'code', 'company', 'brand', 'name', 'large_category_cd', 'middle_category_cd', 'small_category_cd', 'age_cd', 'keyword', 'price_min', 'price_max', 'order', 'start', 'count' |
19
|
|
|
|
|
|
|
]; } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub default_param { { |
22
|
1
|
|
|
1
|
1
|
790
|
'format' => 'xml' |
23
|
|
|
|
|
|
|
}; } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub notnull_param { [ |
26
|
0
|
|
|
0
|
1
|
0
|
'key' |
27
|
|
|
|
|
|
|
]; } |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
0
|
1
|
0
|
sub elem_class { 'WebService::Recruit::Akasugu::Item::Element'; } |
30
|
|
|
|
|
|
|
|
31
|
3
|
|
|
3
|
1
|
33
|
sub root_elem { 'results'; } |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub elem_fields { { |
34
|
3
|
|
|
3
|
0
|
60
|
'error' => ['message'], |
35
|
|
|
|
|
|
|
'image' => ['pc', 'mobile'], |
36
|
|
|
|
|
|
|
'item' => ['code', 'company', 'brand', 'name', 'price', 'catch_copy', 'desc', 'image', 'large_category', 'middle_category', 'small_category', 'urls'], |
37
|
|
|
|
|
|
|
'large_category' => ['code', 'name'], |
38
|
|
|
|
|
|
|
'middle_category' => ['code', 'name'], |
39
|
|
|
|
|
|
|
'results' => ['api_version', 'results_available', 'results_returned', 'results_start', 'item', 'api_version', 'error'], |
40
|
|
|
|
|
|
|
'small_category' => ['code', 'name'], |
41
|
|
|
|
|
|
|
'urls' => ['mobile', 'pc', 'qr'], |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
}; } |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub force_array { [ |
46
|
0
|
|
|
0
|
1
|
|
'item' |
47
|
|
|
|
|
|
|
]; } |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# __PACKAGE__->mk_query_accessors(); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
@WebService::Recruit::Akasugu::Item::Query::ISA = qw( Class::Accessor::Fast ); |
52
|
|
|
|
|
|
|
WebService::Recruit::Akasugu::Item::Query->mk_accessors( @{query_fields()} ); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# __PACKAGE__->mk_elem_accessors(); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
@WebService::Recruit::Akasugu::Item::Element::ISA = qw( Class::Accessor::Children::Fast ); |
57
|
|
|
|
|
|
|
WebService::Recruit::Akasugu::Item::Element->mk_ro_accessors( root_elem() ); |
58
|
|
|
|
|
|
|
WebService::Recruit::Akasugu::Item::Element->mk_child_ro_accessors( %{elem_fields()} ); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 NAME |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
WebService::Recruit::Akasugu::Item - Akasugu.net Web Service "item" API |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 SYNOPSIS |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
use WebService::Recruit::Akasugu; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
my $service = WebService::Recruit::Akasugu->new(); |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
my $param = { |
71
|
|
|
|
|
|
|
'key' => $ENV{'WEBSERVICE_RECRUIT_KEY'}, |
72
|
|
|
|
|
|
|
'large_category_cd' => '2', |
73
|
|
|
|
|
|
|
}; |
74
|
|
|
|
|
|
|
my $res = $service->item( %$param ); |
75
|
|
|
|
|
|
|
my $data = $res->root; |
76
|
|
|
|
|
|
|
print "api_version: $data->api_version\n"; |
77
|
|
|
|
|
|
|
print "results_available: $data->results_available\n"; |
78
|
|
|
|
|
|
|
print "results_returned: $data->results_returned\n"; |
79
|
|
|
|
|
|
|
print "results_start: $data->results_start\n"; |
80
|
|
|
|
|
|
|
print "item: $data->item\n"; |
81
|
|
|
|
|
|
|
print "...\n"; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 DESCRIPTION |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This module is a interface for the C- API.
|
86
|
|
|
|
|
|
|
It accepts following query parameters to make an request. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
my $param = { |
89
|
|
|
|
|
|
|
'key' => 'XXXXXXXX', |
90
|
|
|
|
|
|
|
'code' => '99999', |
91
|
|
|
|
|
|
|
'company' => 'リクルート', |
92
|
|
|
|
|
|
|
'brand' => 'リクルート', |
93
|
|
|
|
|
|
|
'name' => 'トレー', |
94
|
|
|
|
|
|
|
'large_category_cd' => '2', |
95
|
|
|
|
|
|
|
'middle_category_cd' => '210', |
96
|
|
|
|
|
|
|
'small_category_cd' => '210001', |
97
|
|
|
|
|
|
|
'age_cd' => 'a01', |
98
|
|
|
|
|
|
|
'keyword' => 'お手入れ', |
99
|
|
|
|
|
|
|
'price_min' => '2000', |
100
|
|
|
|
|
|
|
'price_max' => '5400', |
101
|
|
|
|
|
|
|
'order' => 'XXXXXXXX', |
102
|
|
|
|
|
|
|
'start' => 'XXXXXXXX', |
103
|
|
|
|
|
|
|
'count' => 'XXXXXXXX', |
104
|
|
|
|
|
|
|
}; |
105
|
|
|
|
|
|
|
my $res = $service->item( %$param ); |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
C<$service> above is an instance of L. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 METHODS |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head2 root |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
This returns the root element of the response. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
my $root = $res->root; |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
You can retrieve each element by the following accessors. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
$root->api_version |
120
|
|
|
|
|
|
|
$root->results_available |
121
|
|
|
|
|
|
|
$root->results_returned |
122
|
|
|
|
|
|
|
$root->results_start |
123
|
|
|
|
|
|
|
$root->item |
124
|
|
|
|
|
|
|
$root->item->[0]->code |
125
|
|
|
|
|
|
|
$root->item->[0]->company |
126
|
|
|
|
|
|
|
$root->item->[0]->brand |
127
|
|
|
|
|
|
|
$root->item->[0]->name |
128
|
|
|
|
|
|
|
$root->item->[0]->price |
129
|
|
|
|
|
|
|
$root->item->[0]->catch_copy |
130
|
|
|
|
|
|
|
$root->item->[0]->desc |
131
|
|
|
|
|
|
|
$root->item->[0]->image |
132
|
|
|
|
|
|
|
$root->item->[0]->large_category |
133
|
|
|
|
|
|
|
$root->item->[0]->middle_category |
134
|
|
|
|
|
|
|
$root->item->[0]->small_category |
135
|
|
|
|
|
|
|
$root->item->[0]->urls |
136
|
|
|
|
|
|
|
$root->item->[0]->image->pc |
137
|
|
|
|
|
|
|
$root->item->[0]->image->mobile |
138
|
|
|
|
|
|
|
$root->item->[0]->large_category->code |
139
|
|
|
|
|
|
|
$root->item->[0]->large_category->name |
140
|
|
|
|
|
|
|
$root->item->[0]->middle_category->code |
141
|
|
|
|
|
|
|
$root->item->[0]->middle_category->name |
142
|
|
|
|
|
|
|
$root->item->[0]->small_category->code |
143
|
|
|
|
|
|
|
$root->item->[0]->small_category->name |
144
|
|
|
|
|
|
|
$root->item->[0]->urls->mobile |
145
|
|
|
|
|
|
|
$root->item->[0]->urls->pc |
146
|
|
|
|
|
|
|
$root->item->[0]->urls->qr |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=head2 xml |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
This returns the raw response context itself. |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
print $res->xml, "\n"; |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=head2 code |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
This returns the response status code. |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
my $code = $res->code; # usually "200" when succeeded |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=head2 is_error |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
This returns true value when the response has an error. |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
die 'error!' if $res->is_error; |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=head1 SEE ALSO |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
L |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=head1 AUTHOR |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
RECRUIT Media Technology Labs |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=head1 COPYRIGHT |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
Copyright 2008 RECRUIT Media Technology Labs |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=cut |
180
|
|
|
|
|
|
|
1; |