Changeset 1506

Show
Ignore:
Timestamp:
08/20/06 19:02:29
Author:
miyagawa
Message:

switch XML::Feed to UserAgent->fetch_parse

Files:

Legend:

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

    r608 r1506  
    44 
    55use URI; 
    6 use XML::Feed
     6use Plagger::UserAgent
    77 
    88sub register { 
     
    2121        or $context->error('ThreadList url is missing'); 
    2222 
     23    my $agent = Plagger::UserAgent->new; 
     24 
    2325    for my $threadlist (@$threadlists) { 
    24         my $remote = XML::Feed->parse(URI->new($threadlist)) or $context->error("feed parse error $threadlist"); 
     26        my $remote = eval { $agent->fetch_parse($threadlist) } 
     27            or $context->error("feed parse error: $@"); 
    2528        for my $r ($remote->entries) { 
    2629            $context->log(info => "thread: ". $r->link); 
    27              
     30 
    2831            my $feed = Plagger::Feed->new; 
    2932            $feed->url($r->link);