line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::NHKProgram::API; |
2
|
5
|
|
|
5
|
|
91305
|
use 5.008005; |
|
5
|
|
|
|
|
20
|
|
|
5
|
|
|
|
|
199
|
|
3
|
5
|
|
|
5
|
|
30
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
177
|
|
4
|
5
|
|
|
5
|
|
25
|
use warnings; |
|
5
|
|
|
|
|
20
|
|
|
5
|
|
|
|
|
122
|
|
5
|
5
|
|
|
5
|
|
21009
|
use Furl; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use WWW::NHKProgram::API::Area qw/fetch_area_id/; |
7
|
|
|
|
|
|
|
use WWW::NHKProgram::API::Date; |
8
|
|
|
|
|
|
|
use WWW::NHKProgram::API::Service qw/fetch_service_id/; |
9
|
|
|
|
|
|
|
use WWW::NHKProgram::API::Provider; |
10
|
|
|
|
|
|
|
use Class::Accessor::Lite::Lazy ( |
11
|
|
|
|
|
|
|
new => 1, |
12
|
|
|
|
|
|
|
ro => [qw/api_key/], |
13
|
|
|
|
|
|
|
ro_lazy => [qw/provider/], |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = "0.03"; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub list { |
19
|
|
|
|
|
|
|
my $self = shift; |
20
|
|
|
|
|
|
|
$self->provider->dispatch('list', @_); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub list_raw { |
24
|
|
|
|
|
|
|
my $self = shift; |
25
|
|
|
|
|
|
|
$self->provider->dispatch('list', @_, 1); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub genre { |
29
|
|
|
|
|
|
|
my $self = shift; |
30
|
|
|
|
|
|
|
$self->provider->dispatch('genre', @_); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub genre_raw { |
34
|
|
|
|
|
|
|
my $self = shift; |
35
|
|
|
|
|
|
|
$self->provider->dispatch('genre', @_, 1); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub info { |
39
|
|
|
|
|
|
|
my $self = shift; |
40
|
|
|
|
|
|
|
$self->provider->dispatch('info', @_); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub info_raw { |
44
|
|
|
|
|
|
|
my $self = shift; |
45
|
|
|
|
|
|
|
$self->provider->dispatch('info', @_, 1); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub now_on_air { |
49
|
|
|
|
|
|
|
my $self = shift; |
50
|
|
|
|
|
|
|
$self->provider->dispatch('now', @_); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub now_on_air_raw { |
54
|
|
|
|
|
|
|
my $self = shift; |
55
|
|
|
|
|
|
|
$self->provider->dispatch('now', @_, 1); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub _build_provider { |
59
|
|
|
|
|
|
|
my $self = shift; |
60
|
|
|
|
|
|
|
return WWW::NHKProgram::API::Provider->new( |
61
|
|
|
|
|
|
|
furl => Furl->new( |
62
|
|
|
|
|
|
|
agent => 'WWW::NHKProgram::API (Perl)', |
63
|
|
|
|
|
|
|
timeout => 10, |
64
|
|
|
|
|
|
|
), |
65
|
|
|
|
|
|
|
api_key => $self->api_key, |
66
|
|
|
|
|
|
|
); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
__END__ |