root/trunk/plagger/assets/plugins/filter-entryfulltext/sportsnavi.pl

Revision 481 (checked in by miyagawa, 14 years ago)
  • Added CustomFeed?::Simple to extract links that match a regexp. Fixes #32
  • Added Plagger::Date->strptime($format, $date)
  • Added decode_content and extract_title to Util
  • Support metadata in Config, for now
Line 
1 sub handle {
2     my($self, $args) = @_;
3     $args->{entry}->link =~ qr!^http://sportsnavi\.yahoo\.co\.jp/.*/headlines/!
4 }
5
6 sub extract {
7     my($self, $args) = @_;
8     if ( $args->{content} =~ /<span class="user1"><span class="line15">(.*?)<!-- \d+.*? -->.*?\[ .*? (\d+.*?) \]/s ) {
9         return {
10             body => $1,
11             date => Plagger::Date->strptime("%Y年%m月%d日 %H:%M", $2),
12         }
13     }
14     return;
15 }
Note: See TracBrowser for help on using the browser.