root/trunk/plagger/lib/Plagger/Plugin/SmartFeed/All.pm

Revision 1292 (checked in by miyagawa, 14 years ago)

SmartFeed?::All: don't set description with title

  • Property svn:keywords set to Id Revision
Line 
1 package Plagger::Plugin::SmartFeed::All;
2 use strict;
3 use base qw( Plagger::Plugin::SmartFeed );
4
5 sub feed_init {
6     my($self, $context, $args) = @_;
7
8     my $feed = Plagger::Feed->new;
9     $feed->type('smartfeed');
10     $feed->id( $self->conf->{id} || ('smartfeed:all') );
11     $feed->title( $self->conf->{title} || "All Entries" );
12     $feed->link( $self->conf->{link} );
13     $feed->description( $self->conf->{description} ) if $self->conf->{description};
14
15     $self->{feed} = $feed;
16 }
17
18 sub feed_finalize {
19     my($self, $context, $args) = @_;
20
21     # because it's "All" you have to dedupe the entries
22     $self->{feed}->dedupe_entries;
23     $self->{feed}->sort_entries;
24
25     $context->update->add($self->{feed}) if $self->{feed}->count;
26 }
27
28 1;
29
Note: See TracBrowser for help on using the browser.