line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package NewsExtractor::SiteSpecificExtractor::www_ustv_com_tw; |
2
|
1
|
|
|
1
|
|
8
|
use utf8; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
36
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
5
|
|
|
|
|
|
|
extends 'NewsExtractor::GenericExtractor'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
353
|
use Importer 'NewsExtractor::TextUtil' => qw(reformat_dateline); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub dateline { |
10
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
11
|
0
|
0
|
|
|
|
|
my $el = $self->dom->at('#share0') or return; |
12
|
0
|
0
|
|
|
|
|
$el = $el->next() or return; |
13
|
0
|
|
|
|
|
|
my ($x) = $el->all_text =~ m/發佈日期:\s+(\S+?)\s+觀看次數/sm; |
14
|
0
|
0
|
|
|
|
|
$x or return; |
15
|
0
|
|
|
|
|
|
return reformat_dateline($x, '+08:00'); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
1; |