« blib/lib/NewsExtractor/SiteSpecificExtractor/www_setn_com.pm
↑ Summary
blib/lib/NewsExtractor/Download.pm »
| 1 | package NewsExtractor::SiteSpecificExtractor::www_ustv_com_tw; | ||||||||||
| 2 | 1 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | extends 'NewsExtractor::GenericExtractor'; | |||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use Importer 'NewsExtractor::TextUtil' => qw(reformat_dateline); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | sub dateline { | ||||||||||
| 10 | 0 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
dateline: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||
| 11 | 0 | ▶ | my $el = $self->dom->at('#share0') or return; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | 0 | ▶ | $el = $el->next() or return; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 0 | my ($x) = $el->all_text =~ m/發佈日期:\s+(\S+?)\s+觀看次數/sm; | |||||||||
| 14 | 0 | ▶ | $x or return; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | 0 | return reformat_dateline($x, '+08:00'); | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 1 | 1; | |||||||||