line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package NewsExtractor::SiteSpecificExtractor::news_ttv_com_tw; |
2
|
1
|
|
|
1
|
|
8
|
use utf8; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
3
|
1
|
|
|
1
|
|
35
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
4
|
|
|
|
|
|
|
extends 'NewsExtractor::GenericExtractor'; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
349
|
use Importer 'NewsExtractor::TextUtil' => qw(u reformat_dateline); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub dateline { |
9
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
10
|
0
|
0
|
|
|
|
|
my $el = $self->dom->at("li.date.time") or return; |
11
|
0
|
|
|
|
|
|
my $t = $el->all_text; |
12
|
0
|
|
|
|
|
|
reformat_dateline( $t, '+08:00' ); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub journalist { |
16
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $x; |
19
|
0
|
|
|
|
|
|
my $t = $self->content_text; |
20
|
0
|
|
|
|
|
|
my @regexps = ( |
21
|
|
|
|
|
|
|
qr{(記者\s*([^/]+?)\s*/.+?報導)}, |
22
|
|
|
|
|
|
|
qr{(責任編輯/\p{Letter}+)\z}, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
for my $re (@regexps) { |
26
|
0
|
|
|
|
|
|
($x) = $t =~ /$re/; |
27
|
0
|
0
|
|
|
|
|
last if $x; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
return $x; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |