| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Net::NicoVideo::Content::Chat; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1321
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
93
|
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
30
|
|
|
5
|
1
|
|
|
1
|
|
5
|
use vars qw($VERSION); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
50
|
|
|
6
|
|
|
|
|
|
|
$VERSION = '0.28'; |
|
7
|
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
5
|
use base qw(Class::Accessor::Fast); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
82
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use vars qw(@Members); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
107
|
|
|
11
|
|
|
|
|
|
|
@Members = qw( |
|
12
|
|
|
|
|
|
|
thread |
|
13
|
|
|
|
|
|
|
no |
|
14
|
|
|
|
|
|
|
vpos |
|
15
|
|
|
|
|
|
|
date |
|
16
|
|
|
|
|
|
|
mail |
|
17
|
|
|
|
|
|
|
user_id |
|
18
|
|
|
|
|
|
|
anonymity |
|
19
|
|
|
|
|
|
|
value |
|
20
|
|
|
|
|
|
|
); |
|
21
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(@Members); |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub members { |
|
24
|
0
|
|
|
0
|
|
|
@Members; |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
package Net::NicoVideo::Content::ViewCounter; |
|
29
|
|
|
|
|
|
|
|
|
30
|
1
|
|
|
1
|
|
5
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
26
|
|
|
31
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
36
|
|
|
32
|
1
|
|
|
1
|
|
5
|
use vars qw($VERSION); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
59
|
|
|
33
|
|
|
|
|
|
|
$VERSION = '0.27_01'; |
|
34
|
|
|
|
|
|
|
|
|
35
|
1
|
|
|
1
|
|
5
|
use base qw(Class::Accessor::Fast); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
73
|
|
|
36
|
|
|
|
|
|
|
|
|
37
|
1
|
|
|
1
|
|
6
|
use vars qw(@Members); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
93
|
|
|
38
|
|
|
|
|
|
|
@Members = qw( |
|
39
|
|
|
|
|
|
|
video |
|
40
|
|
|
|
|
|
|
id |
|
41
|
|
|
|
|
|
|
mylist |
|
42
|
|
|
|
|
|
|
); |
|
43
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(@Members); |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub members { |
|
46
|
0
|
|
|
0
|
|
|
@Members; |
|
47
|
|
|
|
|
|
|
} |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
package Net::NicoVideo::Content::Thread; |
|
50
|
|
|
|
|
|
|
|
|
51
|
1
|
|
|
1
|
|
5
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
33
|
|
|
52
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
26
|
|
|
53
|
1
|
|
|
1
|
|
5
|
use vars qw($VERSION); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
60
|
|
|
54
|
|
|
|
|
|
|
$VERSION = '0.27_01'; |
|
55
|
|
|
|
|
|
|
|
|
56
|
1
|
|
|
1
|
|
6
|
use base qw(Net::NicoVideo::Content Class::Accessor::Fast); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
107
|
|
|
57
|
1
|
|
|
1
|
|
14
|
use XML::TreePP; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
26
|
|
|
58
|
|
|
|
|
|
|
|
|
59
|
1
|
|
|
1
|
|
5
|
use vars qw(@Members); |
|
|
1
|
|
|
|
|
7
|
|
|
|
1
|
|
|
|
|
563
|
|
|
60
|
|
|
|
|
|
|
@Members = qw( |
|
61
|
|
|
|
|
|
|
resultcode |
|
62
|
|
|
|
|
|
|
thread |
|
63
|
|
|
|
|
|
|
last_res |
|
64
|
|
|
|
|
|
|
ticket |
|
65
|
|
|
|
|
|
|
revision |
|
66
|
|
|
|
|
|
|
fork |
|
67
|
|
|
|
|
|
|
server_time |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
view_counter |
|
70
|
|
|
|
|
|
|
chats |
|
71
|
|
|
|
|
|
|
); |
|
72
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(@Members); |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub members { # implement |
|
75
|
0
|
|
|
0
|
0
|
|
@Members; |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub parse { # implement |
|
79
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
80
|
0
|
0
|
|
|
|
|
$self->load($_[0]) if( defined $_[0] ); |
|
81
|
|
|
|
|
|
|
|
|
82
|
0
|
|
|
|
|
|
my $tree = XML::TreePP->new( force_array => 'chat' ) |
|
83
|
|
|
|
|
|
|
->parse($self->_decoded_content); |
|
84
|
|
|
|
|
|
|
|
|
85
|
0
|
|
|
|
|
|
my @chats = (); |
|
86
|
0
|
|
|
|
|
|
for my $c ( @{$tree->{packet}->{chat}} ){ |
|
|
0
|
|
|
|
|
|
|
|
87
|
0
|
|
|
|
|
|
push @chats, Net::NicoVideo::Content::Chat->new({ |
|
88
|
|
|
|
|
|
|
thread => $c->{-thread}, |
|
89
|
|
|
|
|
|
|
no => $c->{-no}, |
|
90
|
|
|
|
|
|
|
vpos => $c->{-vpos}, |
|
91
|
|
|
|
|
|
|
date => $c->{-date}, |
|
92
|
|
|
|
|
|
|
mail => $c->{-mail}, |
|
93
|
|
|
|
|
|
|
user_id => $c->{-user_id}, |
|
94
|
|
|
|
|
|
|
anonymity => $c->{-anonymity}, |
|
95
|
|
|
|
|
|
|
value => $c->{'#text'}, |
|
96
|
|
|
|
|
|
|
}); |
|
97
|
|
|
|
|
|
|
} |
|
98
|
|
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
|
my $v = $tree->{packet}->{view_counter}; |
|
100
|
0
|
|
|
|
|
|
my $vc = Net::NicoVideo::Content::ViewCounter->new({ |
|
101
|
|
|
|
|
|
|
video => $v->{-video}, |
|
102
|
|
|
|
|
|
|
id => $v->{-id}, |
|
103
|
|
|
|
|
|
|
mylist => $v->{-mylist}, |
|
104
|
|
|
|
|
|
|
}); |
|
105
|
|
|
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
my $t = $tree->{packet}->{thread}; |
|
107
|
0
|
|
|
|
|
|
$self->resultcode( $t->{-resultcode} ); |
|
108
|
0
|
|
|
|
|
|
$self->thread( $t->{-thread} ); |
|
109
|
0
|
|
|
|
|
|
$self->last_res( $t->{-last_res} ); |
|
110
|
0
|
|
|
|
|
|
$self->ticket( $t->{-ticket} ); |
|
111
|
0
|
|
|
|
|
|
$self->revision( $t->{-revision} ); |
|
112
|
0
|
|
|
|
|
|
$self->fork( $t->{-fork} ); |
|
113
|
0
|
|
|
|
|
|
$self->server_time( $t->{-server_time} ); |
|
114
|
0
|
|
|
|
|
|
$self->view_counter($vc ); |
|
115
|
0
|
|
|
|
|
|
$self->chats( \@chats ); |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
# status |
|
118
|
0
|
0
|
|
|
|
|
if( defined $self->resultcode ){ |
|
119
|
0
|
|
|
|
|
|
$self->set_status_success; |
|
120
|
|
|
|
|
|
|
}else{ |
|
121
|
0
|
|
|
|
|
|
$self->set_status_error; |
|
122
|
|
|
|
|
|
|
} |
|
123
|
|
|
|
|
|
|
|
|
124
|
0
|
|
|
|
|
|
return $self; |
|
125
|
|
|
|
|
|
|
} |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
sub count { |
|
128
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
129
|
0
|
|
|
|
|
|
scalar @{$self->chats}; |
|
|
0
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
} |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
sub get_comments { |
|
133
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
134
|
0
|
0
|
|
|
|
|
wantarray ? @{$self->chats} : $self->chats; |
|
|
0
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
} |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
1; |
|
138
|
|
|
|
|
|
|
__END__ |