Merged from pod_tweeter branch

This commit is contained in:
Brian O'Donnell
2015-08-09 22:29:05 -04:00
parent b68534361f
commit bd43e14829
+4
View File
@@ -175,6 +175,10 @@ sub update_feed {
my $dbh = connect_to_db( $params{'db_file'} );
foreach my $item ( @$items ){
# strip junk
map { $item->{$_} =~ s/^\s+|\s+$//g } keys %$item;
map { $item->{$_} =~ s/^\n+|\n+$//g } keys %$item;
# check to see if it exists already
my $sth = $dbh->prepare("SELECT guid FROM feeds WHERE guid == ? LIMIT 1") or die "Can't prepare statement: $DBI::errstr";
$sth->execute( $item->{'guid'} ) or die "Can't execute statement: $DBI::errstr";