[Bast-commits] r8828 - ironman/Perlanet-IronMan/lib/Perlanet
idn at dev.catalyst.perl.org
idn at dev.catalyst.perl.org
Sat Feb 27 10:58:34 GMT 2010
Author: idn
Date: 2010-02-27 10:58:34 +0000 (Sat, 27 Feb 2010)
New Revision: 8828
Modified:
ironman/Perlanet-IronMan/lib/Perlanet/IronMan.pm
Log:
Get entry tags and store them in the database. Something about this isn't quite working right I fear.
Modified: ironman/Perlanet-IronMan/lib/Perlanet/IronMan.pm
===================================================================
--- ironman/Perlanet-IronMan/lib/Perlanet/IronMan.pm 2010-02-27 10:57:36 UTC (rev 8827)
+++ ironman/Perlanet-IronMan/lib/Perlanet/IronMan.pm 2010-02-27 10:58:34 UTC (rev 8828)
@@ -115,8 +115,14 @@
next;
}
- # Check that perl is one of those tags
- unless($post->category =~ /perl/i) {
+ my @tags = $post->category;
+
+ # Check that ironman or perl is one of the tags or in the body
+ unless(grep(/ironman/i, @tags) ||
+ grep(/perl/i, @tags) ||
+ $post->content->body =~ /ironman/i ||
+ $post->content->body =~ /perl/i
+ ) {
next;
}
@@ -131,7 +137,7 @@
$self->schema->resultset('Post')->populate( [ {
feed_id => $feed->id,
author => $post->author,
- tags => $post->category,
+ tags => @tags,
url => $post->link,
title => $post->title,
posted_on => $post->issued || DateTime->from_epoch(epoch => 0),
@@ -145,6 +151,7 @@
catch {
Carp::cluck("ERROR: $!\n");
Carp::cluck("ERROR: Link URL is '" . $post->link . "'\n");
+ Carp::cluck("ERROR: Post is:\n" . Dumper($post) . "\n");
};
}
}
More information about the Bast-commits
mailing list