line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::Plurk::Message; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
22
|
use warnings; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
133
|
|
4
|
4
|
|
|
4
|
|
21
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
111
|
|
5
|
4
|
|
|
4
|
|
19
|
use Carp; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
282
|
|
6
|
4
|
|
|
4
|
|
7529
|
use Math::Base36 qw( encode_base36 ); |
|
4
|
|
|
|
|
122345
|
|
|
4
|
|
|
|
|
588
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
WWW::Plurk::Message - A plurk message |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
This document describes WWW::Plurk::Message version 0.02 |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=cut |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SYNOPSIS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use WWW::Plurk; |
23
|
|
|
|
|
|
|
my $plurk = WWW::Plurk->new( 'username', 'password' ); |
24
|
|
|
|
|
|
|
my @plurks = $plurk->plurks; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 DESCRIPTION |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Represents an individual Plurk or response. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Based on Ryan Lim's unofficial PHP API: L |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
BEGIN { |
35
|
4
|
|
|
4
|
|
25
|
my @INFO = qw( |
36
|
|
|
|
|
|
|
author |
37
|
|
|
|
|
|
|
content |
38
|
|
|
|
|
|
|
content_raw |
39
|
|
|
|
|
|
|
id |
40
|
|
|
|
|
|
|
is_mute |
41
|
|
|
|
|
|
|
is_unread |
42
|
|
|
|
|
|
|
lang |
43
|
|
|
|
|
|
|
limited_to |
44
|
|
|
|
|
|
|
no_comments |
45
|
|
|
|
|
|
|
owner_id |
46
|
|
|
|
|
|
|
plurk_id |
47
|
|
|
|
|
|
|
posted |
48
|
|
|
|
|
|
|
qualifier |
49
|
|
|
|
|
|
|
response_count |
50
|
|
|
|
|
|
|
responses_seen |
51
|
|
|
|
|
|
|
source |
52
|
|
|
|
|
|
|
user_id |
53
|
|
|
|
|
|
|
plurk |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
|
56
|
4
|
|
|
|
|
13
|
for my $info ( @INFO ) { |
57
|
4
|
|
|
4
|
|
55
|
no strict 'refs'; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
232
|
|
58
|
72
|
|
|
0
|
|
209
|
*{$info} = sub { shift->{$info} }; |
|
72
|
|
|
|
|
1311
|
|
|
0
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 INTERFACE |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 C<< new >> |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Called internally. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub new { |
71
|
0
|
|
|
0
|
1
|
|
my ( $class, $plurk, $detail, $author ) = @_; |
72
|
0
|
|
|
|
|
|
return bless { |
73
|
|
|
|
|
|
|
plurk => $plurk, |
74
|
|
|
|
|
|
|
author => $author, |
75
|
|
|
|
|
|
|
%$detail, |
76
|
|
|
|
|
|
|
}, $class; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 C<< responses >> |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Get the responses for this Plurk. If called on an object that already |
82
|
|
|
|
|
|
|
represents a response gets the peers of that response (i.e. the other |
83
|
|
|
|
|
|
|
responses to the same Plurk). |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=cut |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub responses { |
88
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
89
|
0
|
|
|
|
|
|
return $self->plurk->responses_for( $self->plurk_id, @_ ); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head2 C<< respond >> |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Respond to a Plurk. See L for details of |
95
|
|
|
|
|
|
|
arguments. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
$msg->respond( content => "I'm free!" ); |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Returns the newly created response. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=cut |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub respond { |
104
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
105
|
0
|
|
|
|
|
|
return $self->plurk->respond_to_plurk( $self->plurk_id, @_ ); |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head2 C<< permalink >> |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Get a URI that is a permanent link to this Plurk. If called on a |
111
|
|
|
|
|
|
|
response gets a permalink to the parent Plurk. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=cut |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub permalink { |
116
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
117
|
0
|
|
|
|
|
|
return $self->plurk->_base_uri . '/p/' |
118
|
|
|
|
|
|
|
. encode_base36( $self->plurk_id ); |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=head2 Accessors |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
The following accessors provide access to the content of this Plurk: |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=over |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=item * C<< author >> |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=item * C<< content >> |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=item * C<< content_raw >> |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=item * C<< id >> |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=item * C<< is_mute >> |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=item * C<< is_unread >> |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item * C<< lang >> |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=item * C<< limited_to >> |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=item * C<< no_comments >> |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=item * C<< owner_id >> |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=item * C<< plurk_id >> |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=item * C<< posted >> |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=item * C<< qualifier >> |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=item * C<< response_count >> |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=item * C<< responses_seen >> |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=item * C<< source >> |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=item * C<< user_id >> |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=item * C<< plurk >> |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=back |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=cut |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
1; |
168
|
|
|
|
|
|
|
__END__ |