Aggregator::Simpleを改造してみた
読了まで:約0分
Aggregator::Simple で
=== lib\\Plagger\\Plugin\\Aggregator\\Simple.pm
==================================================================
--- lib\\Plagger\\Plugin\\Aggregator\\Simple.pm (revision 45)
+++ lib\\Plagger\\Plugin\\Aggregator\\Simple.pm (local)
@@ -71,7 +71,19 @@
my $context = Plagger->context;
- my $args = \{ content => $$xml\_ref \};
+ my $args = \{
+ content => $$xml\_ref,
+ feed => $feed || Plagger::Feed->new,
+ \};
+
+ my $result = $context->run\_hook\_once('aggregator.parse', $args);
+ if ( ref $result eq 'Plagger::Feed' ) \{
+ $context->log(info => "Aggregate $url success: " . $result->count . " entries.");
+ $context->update->add($result);
+ return 1;
+ \}
+
+ $args = \{ content => $$xml\_ref \};
$context->run\_hook('aggregator.filter.feed', $args);
my $remote = eval \{ Plagger::FeedParser->parse(\\$args->\{content\}) \};
aggregator.parse と
テストしようと
#FIXME