NewsExtractor/SiteSpecificExtractor/ChinaTimes.pm

filter: Statementstmt 68.7% 11 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 66.6% 14 / 21 CC 1 SCAR 2.2
CC
1
Cov
69%
content_text
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« NewsExtractor/Article.pm ↑ Summary NewsExtractor/SiteSpecificExtractor/news_tvbs_com_tw.pm »
1 package NewsExtractor::SiteSpecificExtractor::ChinaTimes;
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::JSONLDExtractor';
5  
6 1 ▶use Importer 'NewsExtractor::TextUtil' => qw( html2text );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶sub content_text {
Subroutine content_text: not called CC=1 SCAR=6.9
Pod undocumented
9 0 my ($self) = @_;
10 # my $text = $self->schema_ld->{articleBody} // $self->schema_ld->{description} // '';
11 0 my $body = $self->tx->result->dom->at("div.article-body");
12 0 $body->find(".article-hash-tag")->map('remove');
13 0 my $text = html2text( $body->content );
14 0 return $text;
15 }
16  
17 1 1;
« NewsExtractor/Article.pm ↑ Summary NewsExtractor/SiteSpecificExtractor/news_tvbs_com_tw.pm »