Changeset 573

Show
Ignore:
Timestamp:
04/11/06 15:50:03
Author:
miyagawa
Message:

CustomFeed?::Mixi: Fixed newline bug in messages. Fixes #169
Fixed first-time login bug for non-friend-diary feeds

Files:

Legend:

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

    r477 r573  
    77use WWW::Mixi; 
    88use Time::HiRes; 
     9use URI; 
    910 
    1011our $MAP = { 
     
    6869    my $response  = $self->{mixi}->get($start_url); 
    6970 
     71    my $next_url = URI->new($start_url)->path; 
     72 
    7073    if ($response->content =~ /action=login\.pl/) { 
    7174        $context->log(debug => "Cookie not found. Logging in"); 
    7275        $response = $self->{mixi}->post("http://mixi.jp/login.pl", { 
    73             next_url => "/new_friend_diary.pl"
     76            next_url => $next_url
    7477            email    => $self->conf->{email}, 
    7578            password => $self->conf->{password}, 
     
    151154            if ($item) { 
    152155                my $body = decode('euc-jp', $item->{description}); 
    153                    $body =~ s!\n!<br />!g; 
     156                   $body =~ s!\r\n?!<br />!g; 
    154157                for my $image (@{ $item->{images} }) { 
    155158                    # xxx this should be $entry->enclosures