Changeset 1824

Show
Ignore:
Timestamp:
11/10/06 12:23:11
Author:
kentaro
Message:

created a local branch for Plagger
Filter::HatenaDiaryKeywordUnlink?: now strips links to Hatelabo::AnonimousDiary? keywords

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Filter/HatenaDiaryKeywordUnlink.pm

    r545 r1824  
    1515    my $body = $args->{entry}->body; 
    1616 
    17     my $count = $body =~ s!<a class="o?keyword" href="http://(?:d|[\w\-]+\.g)\.hatena\.ne\.jp/keyword/.*?"[^>]*?>(.*?)</a>!$1!g; 
     17    my $count = $body =~ s!<a (?:class="o?keyword"\s*)?href="http://(?:(?:d|[\w\-]+\.g)\.hatena\.ne\.jp|anond\.hatelabo\.jp)/keyword/.*?"(?:\s*class="keyword")?[^>]*>(.*?)</a>!$1!g; 
    1818 
    1919    if ($count) { 
  • trunk/plagger/t/plugins/Filter-HatenaDiaryKeywordUnlink/base.t

    r1444 r1824  
    1515      entry: 
    1616        - title: bar 
    17           body: <a class="keyword" href="http://d.hatena.ne.jp/keyword/Plagger">Plagger</a> is a pluggable aggregator 
     17          body: <a class="keyword" href="http://d.hatena.ne.jp/keyword/Plagger">Plagger</a> is a pluggable aggregator, which is so to say the duct tape of the <a href="http://anond.hatelabo.jp/keyword/Web" class="keyword">Web</a> 
    1818  - module: Filter::HatenaDiaryKeywordUnlink 
    1919--- expected 
    20 is $context->update->feeds->[0]->entries->[0]->body, "Plagger is a pluggable aggregator
     20is $context->update->feeds->[0]->entries->[0]->body, "Plagger is a pluggable aggregator, which is so to say the duct tape of the Web