Changeset 38

Show
Ignore:
Timestamp:
02/06/06 17:55:27
Author:
miyagawa
Message:

Updated CustomFeed?::Mixi

  • Fix login fail bug
  • Added better handling when your access is blocked
Files:

Legend:

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

    r36 r38  
    3232    unless ($response->is_success) { 
    3333        $context->log(error => "Login failed."); 
     34        return; 
    3435    } 
    3536 
     
    4748 
    4849    my $i = 0; 
     50    my $blocked = 0; 
    4951    for my $msg (@msgs) { 
    5052        next unless $msg->{image}; # external blog 
     
    5759        $entry->date( Plagger::Date->parse($format, $msg->{time}) ); 
    5860 
    59         if ($self->conf->{fetch_body}) { 
     61        if ($self->conf->{fetch_body} && !$blocked) { 
    6062            $context->log(info => "Fetch body from $msg->{link}"); 
    6163            Time::HiRes::sleep( $self->conf->{fetch_body_interval} || 1.5 ); 
     
    6971                } 
    7072                $entry->body($body); 
     73            } else { 
     74                $context->log(warn => "Fetch body failed. You might be blocked?"); 
     75                $blocked++; 
    7176            } 
    7277        }