Changeset 41

Show
Ignore:
Timestamp:
02/06/06 20:13:26
Author:
ko
Message:

Updated CustomFeed?::Mixi

  • Fix login fail bug
  • Added better handling when your access is blocked
  • Replace the regexp pattern.
Files:

Legend:

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

    r40 r41  
    2929 
    3030 
    31     $context->log(error => "Login failed.") 
    32         unless $self->{frepa}->login; 
     31    unless ($self->{frepa}->login) { 
     32        $context->log(error => "Login failed."); 
     33        return; 
     34    } 
    3335 
    3436    $context->log(info => 'Login to frepa succeed.'); 
     
    4547 
    4648    my $i = 0; 
     49    my $blocked = 0; 
    4750    for my $msg (@msgs) { 
    4851        last if $i++ >= $items; 
     
    5457        $entry->date( Plagger::Date->parse($format, $msg->{time}) ); 
    5558 
    56         if ($self->conf->{fetch_body}) { 
     59        if ($self->conf->{fetch_body} && !$blocked) { 
    5760            $context->log(info => "Fetch body from $msg->{link}"); 
    5861            Time::HiRes::sleep( $self->conf->{fetch_body_interval} || 1.5 ); 
     
    6265                   $body =~ s!<br>!<br />!g; 
    6366                $entry->body($body); 
     67            } else { 
     68                $context->log(warn => "Fetch body failed. You might be blocked?"); 
     69                $blocked++; 
    6470            } 
    6571        } 
     
    155161<tr class="bgwhite"> 
    156162<td width="1%" style="padding:5px 30px;" nowrap><small>(\d\d\d\d)..(\d\d)..(\d\d).. (\d\d):(\d\d)</small></td> 
    157 <td width="99%"><img src="/img/icon/diary_fp.gif" border="0" alt=".........." title=".........."> 
     163<td width="99%"><img src="/img/icon/diary_fp.gif" border="0" alt=".*?" title=".*?"> 
    158164<small> 
    159165