line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tweet::ToDelicious::Entity::OnTweet; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
60039
|
use v5.14; |
|
15
|
|
|
|
|
53
|
|
|
15
|
|
|
|
|
517
|
|
4
|
15
|
|
|
15
|
|
79
|
use warnings; |
|
15
|
|
|
|
|
31
|
|
|
15
|
|
|
|
|
499
|
|
5
|
15
|
|
|
15
|
|
3318
|
use parent 'Tweet::ToDelicious::Entity::Interface'; |
|
15
|
|
|
|
|
1322
|
|
|
15
|
|
|
|
|
72
|
|
6
|
15
|
|
|
15
|
|
15509
|
use List::MoreUtils qw(uniq); |
|
15
|
|
|
|
|
19536
|
|
|
15
|
|
|
|
|
1474
|
|
7
|
15
|
|
|
15
|
|
13677
|
use Log::Minimal; |
|
15
|
|
|
|
|
397410
|
|
|
15
|
|
|
|
|
122
|
|
8
|
|
|
|
|
|
|
use Class::Accessor::Lite ( |
9
|
15
|
|
|
|
|
109
|
new => 1, |
10
|
|
|
|
|
|
|
ro => [qw(text in_reply_to_screen_name)], |
11
|
15
|
|
|
15
|
|
21792
|
); |
|
15
|
|
|
|
|
16408
|
|
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
0
|
0
|
0
|
sub screen_name { $_[0]->{user}->{screen_name} } |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub urls { |
16
|
4
|
|
|
4
|
0
|
984
|
my $self = shift; |
17
|
4
|
|
|
|
|
8
|
state @urls; |
18
|
4
|
|
|
|
|
24
|
@urls = uniq( map $_->{expanded_url}, @{ $self->{entities}->{urls} } ); |
|
4
|
|
|
|
|
59
|
|
19
|
4
|
|
|
|
|
31
|
return @urls; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub tags { |
23
|
4
|
|
|
4
|
0
|
2893
|
my $self = shift; |
24
|
4
|
|
|
|
|
7
|
my @tags = map $_->{text}, @{ $self->{entities}->{hashtags} }; |
|
4
|
|
|
|
|
26
|
|
25
|
4
|
|
|
|
|
15
|
my $text = $self->text; |
26
|
4
|
|
|
|
|
75
|
my (@from_text) = $text =~ m/\[([^\]]+?)\]/g; |
27
|
4
|
100
|
|
|
|
52
|
return uniq( @tags, @from_text, $self->{favorited} ? 'favorite' : () ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub posts { |
31
|
3
|
|
|
3
|
0
|
5267
|
my $self = shift; |
32
|
3
|
|
|
|
|
9
|
my @urls = $self->urls; |
33
|
3
|
|
|
|
|
4
|
my @posts; |
34
|
3
|
100
|
|
|
|
10
|
if ( @urls > 0 ) { |
35
|
2
|
|
|
|
|
7
|
my $tags = join ',', $self->tags, 'via:tweet2delicious'; |
36
|
2
|
|
|
|
|
12
|
my $text = $self->text; |
37
|
2
|
|
|
|
|
13
|
for my $url (@urls) { |
38
|
4
|
|
|
|
|
17
|
push @posts, |
39
|
|
|
|
|
|
|
{ |
40
|
|
|
|
|
|
|
url => $url, |
41
|
|
|
|
|
|
|
tags => $tags, |
42
|
|
|
|
|
|
|
description => $text, |
43
|
|
|
|
|
|
|
replace => 1 |
44
|
|
|
|
|
|
|
}; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
3
|
|
|
|
|
11
|
return @posts; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
1; |