Changeset 58

Show
Ignore:
Timestamp:
02/08/06 21:44:53
Author:
miyagawa
Message:

Allow 'title' option, and if there's not, generate better title

Files:

Legend:

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

    r54 r58  
    2222    $feed->type('spliced:tag'); 
    2323    $feed->id( $self->conf->{id} || ('spliced:tag:' . join('+', @tags)) ); 
     24    $feed->title( $self->conf->{title} || $self->gen_title($op, @tags) ); 
    2425 
    2526    for my $f ($context->update->feeds) { 
     
    3839} 
    3940 
     41sub gen_title { 
     42    my($self, $op, @tags) = @_; 
     43    return "Entries tagged with " . 
     44        join(" $op ", map { qq('$_') } @tags); 
     45} 
     46 
    4047sub match_tags { 
    4148    my($self, $op, $entry, $want_tags) = @_;