blib/lib/NewsExtractor/SiteSpecificExtractor/yimedia_com_tw.pm

filter: Statementstmt 50.0% 12 / 24 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 1 totaltotal 39.4% 15 / 38 CC 5 SCAR 21.2
CC
5
Cov
38%
__ANON__
12.0
journalist
12.0
BEGIN
1.0
CRAP 8.3
« blib/lib/NewsExtractor/JSONLDExtractor.pm ↑ Summary blib/lib/NewsExtractor/SiteSpecificExtractor/ETtoday.pm »
1 package NewsExtractor::SiteSpecificExtractor::yimedia_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' => 'normalize_whitespace', 'u';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 before 'content_text', sub {
9 0 ▶ my ($self) = @_;
Subroutine __ANON__: not called CC=3 SCAR=24.8
10 0 $self->dom->find('figure.fbyt-block')->map('remove');
11 0 ▶ if (my $el = $self->dom->at('#penci-post-entry-inner > p:last-of-type')) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $el = $self->dom->at("#penci-post-entry-inner > p:last-of-type")) 0 0 0
12 0 print $el->content() ."\n";
13 0 ▶ if ($el->content() =~ /\A看更多<br>/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($el->content =~ /\A\x{770b}\x{66f4}\x{591a}<br>/) 0 0 0
14 0 $el->remove();
15 }
16 }
17 1 };
18  
19 sub journalist {
20 0 ▶ my $self = $_[0];
Subroutine journalist: not called CC=3 SCAR=24.8
Pod undocumented
21 0 my $ret;
22 0 ▶ if (my $el = $self->dom->at('#penci-post-entry-inner > p:nth-child(1)')) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $el = $self->dom->at("#penci-post-entry-inner > p:nth-child(1)")) 0 0 0
23 0 ▶ if ($el->content() =~ /文字撰稿:(?<name> \p{Letter}+ )<br>/x) {
Branch: 1 branch
BranchTrueFalseTotal
if ($el->content =~ /\x{6587}\x{5b57}\x{64b0}\x{7a3f}\x{ff1a}(?<name> \p{Letter}+ )<br>/x) 0 0 0
24 0 ($ret) = $+{"name"};
25 }
26  
27 }
28 0 return $ret;
29 }
30  
31 1 1;
« blib/lib/NewsExtractor/JSONLDExtractor.pm ↑ Summary blib/lib/NewsExtractor/SiteSpecificExtractor/ETtoday.pm »