Changeset 84

Show
Ignore:
Timestamp:
02/17/06 18:37:29
Author:
miyagawa
Message:

Unified SmartFeed? and Rule API by ad-hoc hook addition. Fixes #28 and #31.

Files:

Legend:

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

    r79 r84  
    151151    $self->run_hook('update.fixup'); 
    152152 
     153    $self->run_hook('smartfeed.init'); 
     154    for my $feed ($self->update->feeds) { 
     155        for my $entry ($feed->entries) { 
     156            $self->run_hook('smartfeed.entry', { feed => $feed, entry => $entry }); 
     157        } 
     158    } 
     159 
    153160    for my $feed ($self->update->feeds) { 
    154161        for my $entry ($feed->entries) { 
  • trunk/plagger/lib/Plagger/Rule.pm

    r78 r84  
    2121sub init { } 
    2222 
     23sub id { 
     24    my $self = shift; 
     25    "xxx"; 
     26} 
     27 
     28sub as_title { 
     29    my $self = shift; 
     30    "xxx"; 
     31} 
     32 
    23331; 
  • trunk/plagger/lib/Plagger/Rules.pm

    r78 r84  
    3030} 
    3131 
     32sub id { 
     33    my $self = shift; 
     34    join '|', map $_->id, @{$self->{rules}}; 
     35} 
     36 
     37sub as_title { 
     38    my $self = shift; 
     39    join " $self->{op} ", map $_->as_title, @{$self->{rules}}; 
     40} 
     41 
    32421;