line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::NHKProgram::API::Provider::Info; |
2
|
1
|
|
|
1
|
|
908
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
5
|
1
|
|
|
1
|
|
20
|
use JSON (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
27
|
|
6
|
1
|
|
|
1
|
|
5
|
use WWW::NHKProgram::API::Area qw/fetch_area_id/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
7
|
1
|
|
|
1
|
|
5
|
use WWW::NHKProgram::API::Service qw/fetch_service_id/; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
37
|
|
8
|
1
|
|
|
1
|
|
5
|
use WWW::NHKProgram::API::Provider::Common; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
177
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub call { |
11
|
0
|
|
|
0
|
0
|
|
my ($self, $context, $arg, $raw) = @_; |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
|
my $area = fetch_area_id($arg->{area}); |
14
|
0
|
|
|
|
|
|
my $service = fetch_service_id($arg->{service}); |
15
|
0
|
|
|
|
|
|
my $id = $arg->{id}; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $content = WWW::NHKProgram::API::Provider::Common::call( |
18
|
|
|
|
|
|
|
$context, |
19
|
|
|
|
|
|
|
"info/%(area)s/%(service)s/%(id)s.json", |
20
|
|
|
|
|
|
|
{ |
21
|
|
|
|
|
|
|
area => $area, |
22
|
|
|
|
|
|
|
service => $service, |
23
|
|
|
|
|
|
|
id => $id, |
24
|
|
|
|
|
|
|
}, |
25
|
|
|
|
|
|
|
$raw, |
26
|
|
|
|
|
|
|
); |
27
|
0
|
0
|
|
|
|
|
return $content if $raw; |
28
|
0
|
|
|
|
|
|
return JSON::decode_json($content)->{list}->{$service}->[0]; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |