Changeset 542

Show
Ignore:
Timestamp:
04/05/06 17:14:21
Author:
miyagawa
Message:

Fix Frepa RecentComment? bugs.

  • Fix link URI escape bug
  • Fix RecentComment? buddy icon of yourself doesn't show up correctly. Fixes #155
Files:

Legend:

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

    r461 r542  
    5454    my ($self, $context, $plugin, $args) = @_; 
    5555 
    56  
    5756    my $feed = Plagger::Feed->new; 
    5857    $feed->type('frepa'); 
     
    6261    my $format = DateTime::Format::Strptime->new(pattern => '%Y/%m/%d %H:%M'); 
    6362 
    64     my @msgs = $plugin->get_list($self->{mech}); 
     63    my @msgs = $plugin->get_list($self->{mech}, $self); 
    6564    my $items = $self->conf->{fetch_items} || 20; 
    6665 
     
    171170sub top_re { 
    172171    return <<'RE'; 
    173 <a href="http://frepa\.livedoor\.com/.*?/"(?: rel="popup")?><img src="(http://img\d+\.(?:ico\.frepa\.livedoor\.com/member_photo/|bbs\.frepa\.livedoor\.com/community_board/).*?\.(?:jpe?g|JPE?G|gif|GIF|png|PNG))" border="0"></a> 
     172<a href="http://(?:frepa\.livedoor\.com/.*?/|www\.frepa\.livedoor\.com/)"(?: rel="popup")?><img src="(http://img\d+\.(?:ico\.frepa\.livedoor\.com/member_photo/|bbs\.frepa\.livedoor\.com/community_board/).*?\.(?:jpe?g|JPE?G|gif|GIF|png|PNG))" border="0"></a> 
    174173</small> 
    175174.*? 
  • trunk/plagger/lib/Plagger/Plugin/CustomFeed/Frepa/RecentComment.pm

    r458 r542  
    1111 
    1212sub get_list { 
    13     my ($self, $mech) = @_; 
     13    my($self, $mech, $plugin) = @_; 
    1414 
    1515    my @msgs = (); 
     
    2323        my ($link, $subject, $user_link, $name) = 
    2424            (decode_entities($6), decode_entities($7), decode_entities($8), decode_entities($9)); 
    25         my $uri = URI->new($self->start_url); 
    26         $uri->path($link); 
     25        my $uri = URI->new_abs($link, $self->start_url); 
    2726        $link = $uri->as_string; 
     27 
     28        # your post doesn't link to your profile, ick 
     29        if ($user_link =~ m!www\.frepa\.livedoor\.com/$!) { 
     30            $user_link = "http://frepa.livedoor.com/" . $plugin->conf->{livedoor_id} . "/"; 
     31        } 
    2832 
    2933        push(@msgs, +{