[Bast-commits] r8833 - ironman/Perlanet-IronMan/bin

idn at dev.catalyst.perl.org idn at dev.catalyst.perl.org
Sun Feb 28 21:07:35 GMT 2010


Author: idn
Date: 2010-02-28 21:07:35 +0000 (Sun, 28 Feb 2010)
New Revision: 8833

Modified:
   ironman/Perlanet-IronMan/bin/ironman-collector.pl
Log:
Removed incompatible alteration of the render call now that select_entries does the right thing in returning Perlanet::Entry objects with references to their Perlanet::Feed objects.  Added filtering!

Modified: ironman/Perlanet-IronMan/bin/ironman-collector.pl
===================================================================
--- ironman/Perlanet-IronMan/bin/ironman-collector.pl	2010-02-28 21:06:21 UTC (rev 8832)
+++ ironman/Perlanet-IronMan/bin/ironman-collector.pl	2010-02-28 21:07:35 UTC (rev 8833)
@@ -17,10 +17,13 @@
 $cfg->{agent} = "Perlanet";
 $cfg->{author}->{name} = "Perlanet";
 $cfg->{feed}->{format} = "RSS";
-$cfg->{entries} = 5;
+$cfg->{entries} = 10;
 
+$cfg->{filter}->{keywords} = ["cpan", "ironman", "perl"];
+
 # Database
 $cfg->{db}{dsn} = "dbi:SQLite:/var/www/ironboy.enlightenedperl.org/ironman/subscriptions.db";
+$cfg->{db}{dsn} = "dbi:SQLite:/var/www/ironboy.enlightenedperl.org/ironman/testsubscriptions.db";
 
 # Get me a Perlanet::IronMan thingy using our config from above
 my $p = Perlanet::IronMan->new( cfg => $cfg );
@@ -33,7 +36,7 @@
 $p->update_opml;
 
 # Get the list of feeds from the database
-print("Fetching feeds object\n");
+print("Fetching the Perlanet::Feed objects array\n");
 my $feeds_obj = $p->feeds;
 
 # Sample data:
@@ -52,9 +55,9 @@
 #print("Fetching the feed data\n");
 #my @feeds_data = $p->fetch_feeds( @{ $feeds_obj } );
 
-foreach my $feed ( @{ $feeds_obj } ) {
-    #print("Fetching posts from feed '" . $feed->url . "'\n");
-    my @feed_posts = $p->fetch_feeds( $feed );
+foreach my $feed_obj ( @{ $feeds_obj } ) {
+    #print("Fetching posts from feed '" . $feed_obj->url . "'\n");
+    my @feed_posts = $p->fetch_feeds( $feed_obj );
 
     #print(Dumper(@feed_posts));
     #exit;
@@ -68,7 +71,7 @@
 
     #print("Building a post object\n");
     my $post = $p->build_feed(@feed_posts);
-    $p->render($feed, $post);
+    $p->render($post);
 
 }
 




More information about the Bast-commits mailing list