Changeset 1887

Show
Ignore:
Timestamp:
11/29/06 12:16:31
Author:
miyagawa
Message:

use FeedParser? and UserAgent? in Subscription::HatenaGroup?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Subscription/HatenaGroup.pm

    r361 r1887  
    44 
    55use URI; 
    6 use XML::Feed; 
     6use Plagger::FeedParser; 
     7use Plagger::UserAgent; 
    78 
    89sub register { 
     
    2324    my $feed_uri = "http://$group.g.hatena.ne.jp/diarylist?mode=rss"; 
    2425 
    25     my $remote = XML::Feed->parse(URI->new($feed_uri)) or $context->error("feed parse error $feed_uri"); 
     26    my $agent = Plagger::UserAgent->new; 
     27    my $remote = eval { $agent->fetch_parse(URI->new($feed_uri)) } 
     28        or $context->error("feed parse error $feed_uri: $@"); 
    2629    for my $r ($remote->entries) { 
    2730        $context->log(info => "diary: ". $r->link);