Changeset 803

Show
Ignore:
Timestamp:
05/24/06 15:56:25
Author:
miyagawa
Message:

CustomFeed?::GoogleNews? to accept keyword search page as well. Fixes #255

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/CustomFeed/GoogleNews.pm

    r557 r803  
    5454    $feed->link($args->{feed}->url); 
    5555 
    56     while ($content =~ m!<a href="(http://[^"]*)" id=r-\d[^>]*><b>([^<]*)</b></a>!g) { 
     56    while ($content =~ m!<a href="(http://[^"]*)" id=r-\d[^>]*>(.*?)</a>!g) { 
     57        my($link, $title) = ($1, $2); 
     58        $title =~ s!<b>(.*?)</b>!$1!g; 
     59 
    5760        my $entry = Plagger::Entry->new; 
    58         $entry->title($2); 
    59         $entry->link($1); 
     61        $entry->title($title); 
     62        $entry->link($link); 
     63 
    6064        $feed->add_entry($entry); 
    6165    } 
     
    7882      feed: 
    7983        - http://news.google.com/news?ned=jp&rec=0&topic=s 
     84        - http://news.google.co.jp/news?hl=ja&ned=jp&q=%E5%9B%B2%E7%A2%81 
    8085 
    8186  - module: CustomFeed::GoogleNews