NewsExtractor/SiteSpecificExtractor/new_ctv_com_tw.pm

filter: Statementstmt 57.8% 11 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 2 totaltotal 53.8% 14 / 26 CC 1 SCAR 3.4
CC
1
Cov
58%
headline
2.0
dateline
2.0
BEGIN
1.0
CRAP 1.4
« NewsExtractor/Extractor.pm ↑ Summary NewsExtractor/SiteSpecificExtractor/www_penghutimes_com.pm »
1 package NewsExtractor::SiteSpecificExtractor::new_ctv_com_tw;
2 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 extends 'NewsExtractor::GenericExtractor';
5  
6 1 ▶use Importer 'NewsExtractor::TextUtil' => qw(u);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶sub headline {
Subroutine headline: not called CC=1 SCAR=6.9
Pod undocumented
9 0 my ($self) = @_;
10 0 my $headline = $self->dom->at('meta[property="og:title"][content]')->attr('content');
11 0 $headline =~ s/│中視新聞 [0-9]{8}\z//;
12 0 return $headline;
13 };
14  
15 0 ▶sub dateline {
Subroutine dateline: not called CC=1 SCAR=6.9
Pod undocumented
16 0 my ($self) = @_;
17 0 my $dateline = $self->dom->at("div.author")->text =~ s /\A中視新聞 \| //r;
18 0 my @t = split /[^0-9]+/, $dateline;
19 0 return u( sprintf('%04d-%02d-%02dT%02d:%02d:%02d+08:00', $t[0], $t[1], $t[2], $t[3], $t[4], $t[5]) );
20 }
21  
22 1 1;
« NewsExtractor/Extractor.pm ↑ Summary NewsExtractor/SiteSpecificExtractor/www_penghutimes_com.pm »