File Coverage

blib/lib/NewsExtractor/SiteSpecificExtractor/estate_ltn_com_tw.pm
Criterion Covered Total %
statement 9 24 37.5
branch n/a
condition n/a
subroutine 3 7 42.8
pod 0 4 0.0
total 12 35 34.2


line stmt bran cond sub pod time code
1             package NewsExtractor::SiteSpecificExtractor::estate_ltn_com_tw;
2 1     1   10 use utf8;
  1         3  
  1         9  
3 1     1   37 use Moo;
  1         3  
  1         8  
4             extends 'NewsExtractor::SiteSpecificExtractor';
5              
6 1     1   368 use Importer 'NewsExtractor::TextUtil' => qw< normalize_whitespace html2text >;
  1         3  
  1         11  
7              
8             sub headline {
9 0     0 0   my ($self) = @_;
10 0           my $el = $self->dom->at('div.container.page-name > h1');
11 0           return $el->all_text;
12             }
13              
14             sub dateline {
15 0     0 0   my ($self) = @_;
16 0           my $el = $self->dom->at('p.author .time');
17 0           my $txt = $el->all_text;
18 0           return $txt;
19             }
20              
21             sub journalist {
22 0     0 0   my ($self) = @_;
23 0           my $el = $self->dom->at('p.author');
24 0           $el->children("div.share")->map('remove');
25 0           return normalize_whitespace($el->text);
26             }
27              
28             sub content_text {
29 0     0 0   my ($self) = @_;
30 0           my $el = $self->dom->at("div[itemprop=articleBody]");
31 0           $el->children("p.appE1121")->map('remove');
32 0           return html2text( $el->to_string );
33             }
34              
35             1;