Permalink
Browse files

add Filter::Reverse

  • Loading branch information...
1 parent ab61901 commit 7cf4f7a7290854460e3950d84385daa48b8990d4 @mteramoto mteramoto committed Jun 14, 2009
Showing with 22 additions and 0 deletions.
  1. +22 −0 lib/Plagger/Plugin/Filter/Reverse.pm
@@ -0,0 +1,22 @@
+package Plagger::Plugin::Filter::Reverse;
+use strict;
+use base qw( Plagger::Plugin );
+
+sub register {
+ my($self, $context) = @_;
+ $context->register_hook(
+ $self,
+ 'update.feed.fixup' => \&feed
+ );
+}
+
+sub feed {
+ my($self, $context, $args) = @_;
+
+ $context->log(debug => "reverse");
+ my @entries = $args->{feed}->entries;
+ @entries = reverse(@entries);
+ $args->{feed}->{entries} = \@entries;
+}
+
+1;

0 comments on commit 7cf4f7a

Please sign in to comment.