line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
use utf8; |
2
|
1
|
|
|
1
|
|
6
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
3
|
1
|
|
|
1
|
|
26
|
extends 'NewsExtractor::GenericExtractor'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use Importer 'NewsExtractor::TextUtil' => qw(u); |
6
|
1
|
|
|
1
|
|
273
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
my ($self) = @_; |
8
|
|
|
|
|
|
|
my $headline = $self->dom->at('meta[property="og:title"][content]')->attr('content'); |
9
|
0
|
|
|
0
|
0
|
|
$headline =~ s/│中視新聞 [0-9]{8}\z//; |
10
|
0
|
|
|
|
|
|
return $headline; |
11
|
0
|
|
|
|
|
|
}; |
12
|
0
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my ($self) = @_; |
14
|
|
|
|
|
|
|
my $dateline = $self->dom->at("div.author")->text =~ s /\A中視新聞 \| //r; |
15
|
|
|
|
|
|
|
my @t = split /[^0-9]+/, $dateline; |
16
|
0
|
|
|
0
|
0
|
|
return u( sprintf('%04d-%02d-%02dT%02d:%02d:%02d+08:00', $t[0], $t[1], $t[2], $t[3], $t[4], $t[5]) ); |
17
|
0
|
|
|
|
|
|
} |
18
|
0
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
1; |