Changeset 559
- Timestamp:
- 04/07/06 20:13:59
- Files:
-
- trunk/plagger/assets/plugins/filter-entryfulltext/chugoku-np.yaml (added)
- trunk/plagger/assets/plugins/filter-entryfulltext/daily_sports.yaml (added)
- trunk/plagger/assets/plugins/filter-entryfulltext/jp_uefa.yaml (added)
- trunk/plagger/assets/plugins/filter-entryfulltext/netkeiba.yaml (added)
- trunk/plagger/assets/plugins/filter-entryfulltext/nikkansports.yaml (modified) (1 diff)
- trunk/plagger/assets/plugins/filter-entryfulltext/sanspo.yaml (added)
- trunk/plagger/assets/plugins/filter-entryfulltext/sponichi.yaml (added)
- trunk/plagger/assets/plugins/filter-entryfulltext/yomiuri.yaml (added)
- trunk/plagger/assets/plugins/filter-entryfulltext/zzz_google_adsense.pl (added)
- trunk/plagger/lib/Plagger/Plugin/Filter/EntryFullText.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/assets/plugins/filter-entryfulltext/nikkansports.yaml
r525 r559 4 4 custom_feed_follow_link: /\w+/[fp]-\w\w-tp\d+-\d{8}-\d+\.html$ 5 5 handle: http://[\w\-]+.nikkansports.com/\w+/ 6 extract: <h2>.*?</h2>\s*((?:<p>|<!-- \+\+\+\+\+).*?)<p>[(\d{4}年\d\d?月\d\d?日\d\d?時\d\d?分)(?: 紙面から)?]</p> 7 extract_capture: body date 8 extract_date_format: %Y年%m月%d日%H時%M分 6 extract: <div id="news">.*?<h2>(.*?)</h2>\s*((?:<p>|<!-- \+\+\+\+\+).*?)<p>[(\d{4}年\d\d?月\d\d?日\d\d?時\d\d?分|\d{4}/\d\d?/\d\d?/\d\d:\d\d)(?: 紙面から)?]</p> 7 extract_capture: title body date 8 extract_date_format: 9 - %Y年%m月%d日%H時%M分 10 - %Y/%m/%d %H:%M 11 trunk/plagger/lib/Plagger/Plugin/Filter/EntryFullText.pm
r556 r559 37 37 my $dh = DirHandle->new($dir) or $context->error("$dir: $!"); 38 38 for my $file (grep -f $_->[0] && $_->[0] =~ /\.(?:pl|yaml)$/, 39 map [ File::Spec->catfile($dir, $_), $_ ], $dh->read) {39 map [ File::Spec->catfile($dir, $_), $_ ], sort $dh->read) { 40 40 $self->load_plugin(@$file); 41 41 } … … 164 164 package Plagger::Plugin::Filter::EntryFullText::YAML; 165 165 use Encode; 166 use List::Util qw(first); 166 167 167 168 sub new { … … 217 218 218 219 if ($data->{date}) { 219 if ($self->{extract_date_format}) { 220 $data->{date} = Plagger::Date->strptime($self->{extract_date_format}, $data->{date}); 220 if (my $format = $self->{extract_date_format}) { 221 $format = [ $format ] unless ref $format; 222 $data->{date} = (map { Plagger::Date->strptime($_, $data->{date}) } @$format)[0]; 221 223 } else { 222 224 $data->{date} = Plagger::Date->parse_dwim($data->{date});
