line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::NHKProgram::API::Provider::Now; |
2
|
1
|
|
|
1
|
|
843
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
34
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
4
|
1
|
|
|
1
|
|
3
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
5
|
1
|
|
|
1
|
|
16
|
use JSON (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
6
|
1
|
|
|
1
|
|
5
|
use WWW::NHKProgram::API::Area qw/fetch_area_id/; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
38
|
|
7
|
1
|
|
|
1
|
|
4
|
use WWW::NHKProgram::API::Service qw/fetch_service_id/; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
36
|
|
8
|
1
|
|
|
1
|
|
4
|
use WWW::NHKProgram::API::Provider::Common; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
167
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub call { |
11
|
0
|
|
|
0
|
0
|
|
my ($class, $context, $arg, $raw) = @_; |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
|
my $area = fetch_area_id($arg->{area}); |
14
|
0
|
|
|
|
|
|
my $service = fetch_service_id($arg->{service}); |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
my $content = WWW::NHKProgram::API::Provider::Common::call( |
17
|
|
|
|
|
|
|
$context, |
18
|
|
|
|
|
|
|
"now/%(area)s/%(service)s.json", |
19
|
|
|
|
|
|
|
{ |
20
|
|
|
|
|
|
|
area => $area, |
21
|
|
|
|
|
|
|
service => $service, |
22
|
|
|
|
|
|
|
}, |
23
|
|
|
|
|
|
|
$raw, |
24
|
|
|
|
|
|
|
); |
25
|
0
|
0
|
|
|
|
|
return $content if $raw; |
26
|
0
|
|
|
|
|
|
return JSON::decode_json($content)->{nowonair_list}->{$service}; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |