« blib/lib/NewsExtractor/SiteSpecificExtractor/estate_ltn_com_tw.pm
↑ Summary
blib/lib/NewsExtractor/Extractor.pm »
| 1 | package NewsExtractor::SiteSpecificExtractor::www_rti_org_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' => ('html2text', 'normalize_whitespace', 'reformat_dateline'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | sub headline { | ||
| 9 | 0 | ▶ | my ($self) = @_; |
|
Subroutine
headline: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 10 | 0 | my $el = $self->dom->at('.news-detail-box > hgroup:nth-child(1) > h1:nth-child(1)'); | |
| 11 | 0 | return normalize_whitespace( $el->all_text ); | |
| 12 | } | ||
| 13 | |||
| 14 | sub dateline { | ||
| 15 | 0 | ▶ | my ($self) = @_; |
|
Subroutine
dateline: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 16 | 0 | my $el = $self->dom->at('.date'); | |
| 17 | 0 | my $txt = normalize_whitespace( $el->all_text ); | |
| 18 | 0 | $txt =~ s/^時間://; | |
| 19 | 0 | return reformat_dateline($txt, '+08:00'); | |
| 20 | } | ||
| 21 | |||
| 22 | sub journalist { | ||
| 23 | 0 | ▶ | my ($self) = @_; |
|
Subroutine
journalist: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 24 | 0 | my $el = $self->dom->at('li.source:nth-child(3)'); | |
| 25 | 0 | return $el->all_text; | |
| 26 | } | ||
| 27 | |||
| 28 | sub content_text { | ||
| 29 | 0 | ▶ | my ($self) = @_; |
|
Subroutine
content_text: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 30 | 0 | my $el = $self->dom->at('.news-detail-box > article:nth-child(4)'); | |
| 31 | 0 | return html2text( $el->to_string ); | |
| 32 | } | ||
| 33 | |||
| 34 | 1 | 1; | |