« NewsExtractor/SiteSpecificExtractor/www_ksnews_com_tw.pm
↑ Summary
NewsExtractor/SiteSpecificExtractor/www_rti_org_tw.pm »
| 1 | package NewsExtractor::SiteSpecificExtractor::estate_ltn_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::SiteSpecificExtractor'; | |
| 5 | |||
| 6 | 1 | ▶ | use Importer 'NewsExtractor::TextUtil' => qw< normalize_whitespace html2text >; |
|
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 $el = $self->dom->at('div.container.page-name > h1'); | |
| 11 | 0 | return $el->all_text; | |
| 12 | } | ||
| 13 | |||
| 14 | 0 | ▶ | sub dateline { |
|
Subroutine
dateline: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 15 | 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 | 0 | ▶ | sub journalist { |
|
Subroutine
journalist: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 22 | 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 | 0 | ▶ | sub content_text { |
|
Subroutine
content_text: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 29 | 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 | 1; | |