« NewsExtractor/SiteSpecificExtractor/www_ttv_com_tw.pm
↑ Summary
NewsExtractor/SiteSpecificExtractor/money_udn_com.pm »
| 1 | package NewsExtractor::SiteSpecificExtractor::www_nownews_com; | ||||||||||
| 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( reformat_dateline 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 | return $self->dom->at('h3.newsTitle')->text; | |||||||||
| 11 | } | ||||||||||
| 12 | |||||||||||
| 13 | 0 | ▶ | sub content_text { | ||||||||
|
Subroutine
content_text: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 14 | 0 | my ($self) = @_; | |||||||||
| 15 | 0 | ▶ | my $el = $self->dom->at('div.newsMsg') or return; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 0 | return html2text( $el->to_string ); | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 0 | ▶ | sub dateline { | ||||||||
|
Subroutine
dateline: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 20 | 0 | my ($self) = @_; | |||||||||
| 21 | 0 | return reformat_dateline( $self->dom->at('div.newsInfo')->all_text(), '+08:00' ); | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 0 | ▶ | sub journalist { | ||||||||
|
Subroutine
journalist: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 25 | 0 | my ($self) = @_; | |||||||||
| 26 | 0 | my ($x) = $self->dom->at('div.newsInfo')->all_text =~ m{^記者(.+)/\S+報導-}; | |||||||||
| 27 | 0 | return $x; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 1 | 1; | |||||||||