Changeset 608

Show
Ignore:
Timestamp:
04/16/06 22:49:33
Author:
youpy
Message:

Subscription::2chThreadList now can load multiple urls.

Files:

Legend:

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

    r587 r608  
    1818    my($self, $context) = @_; 
    1919 
    20     my $threadlist_uri = $self->conf->{url} 
     20    my $threadlists = ref($self->conf->{url}) ? $self->conf->{url} : [ $self->conf->{url} ] 
    2121        or $context->error('ThreadList url is missing'); 
    2222 
    23     my $remote = XML::Feed->parse(URI->new($threadlist_uri)) or $context->error("feed parse error $threadlist_uri"); 
    24     for my $r ($remote->entries) { 
    25         $context->log(info => "thread: ". $r->link); 
    26  
    27         my $feed = Plagger::Feed->new; 
    28         $feed->url($r->link); 
    29         $feed->link($r->link); 
    30         $feed->title($r->title); 
    31         $context->subscription->add($feed); 
     23    for my $threadlist (@$threadlists) { 
     24        my $remote = XML::Feed->parse(URI->new($threadlist)) or $context->error("feed parse error $threadlist"); 
     25        for my $r ($remote->entries) { 
     26            $context->log(info => "thread: ". $r->link); 
     27             
     28            my $feed = Plagger::Feed->new; 
     29            $feed->url($r->link); 
     30            $feed->link($r->link); 
     31            $feed->title($r->title); 
     32            $context->subscription->add($feed); 
     33        } 
    3234    } 
    3335}