[Bast-commits] r9946 - ironman/Perlanet-IronMan/branches/dev/lib/Perlanet

idn at dev.catalyst.perl.org idn at dev.catalyst.perl.org
Sat Sep 22 11:08:15 GMT 2012


Author: idn
Date: 2012-09-22 11:08:15 +0000 (Sat, 22 Sep 2012)
New Revision: 9946

Modified:
   ironman/Perlanet-IronMan/branches/dev/lib/Perlanet/IronMan.pm
Log:
Sync with trunk.

Modified: ironman/Perlanet-IronMan/branches/dev/lib/Perlanet/IronMan.pm
===================================================================
--- ironman/Perlanet-IronMan/branches/dev/lib/Perlanet/IronMan.pm	2012-09-22 11:07:51 UTC (rev 9945)
+++ ironman/Perlanet-IronMan/branches/dev/lib/Perlanet/IronMan.pm	2012-09-22 11:08:15 UTC (rev 9946)
@@ -123,14 +123,14 @@
         # This should probably be in config rather than hard coded.
         my $summary = $post->_entry->summary->body || $post->_entry->content->body;
 
-#        my $truncated = eval { $self->truncator->truncate($summary) };
-#        if ($@) {
-#            warn "Truncate failed: $@";
-#            $truncated = $summary;
-#        }
-#
-#        $summary = $truncated;
+        my $truncated = eval { $self->truncator->truncate($summary) };
+        if ($@) {
+            warn "Truncate failed: $@";
+            $truncated = $summary;
+        }
 
+        $summary = $truncated;
+
         # Can't store a post if we can't work out the URL to link to it.
         unless(defined($post->_entry->link)) {
             print("ERROR.  Can't deal with lack of URL returned from XML::Feed::Entry for feed '" . $post->feed->url . "'\n");
@@ -326,21 +326,21 @@
 
         # If tags have been defined, check them.
         if(defined($xml_entry->tags)) {
-            if(grep(/$filter/i, $xml_entry->tags)) {
+            if(grep(/\b$filter\b/i, $xml_entry->tags)) {
                 return 1;
             }
         }
 
         # Check the title if defined
         if(defined($xml_entry->title)) {
-            if(grep(/$filter/i, $xml_entry->title)) {
+            if(grep(/\b$filter\b/i, $xml_entry->title)) {
                 return 1;
             }
         }
 
         # Check the body if defined
         if(defined($xml_entry->content->body)) {
-            if($xml_entry->content->body =~ m/$filter/i) {
+            if($xml_entry->content->body =~ m/\b$filter\b/i) {
                 return 1;
             }
         }




More information about the Bast-commits mailing list