From ace5b34ebddcf1f63af7ca4cac13d69e14b138bf Mon Sep 17 00:00:00 2001 From: Brian O'Donnell Date: Mon, 20 Apr 2015 10:03:31 -0400 Subject: [PATCH] update_feed now saves the 'title' attribute to the database --- pod_feeder.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pod_feeder.pl b/pod_feeder.pl index 8cae215..a7ed1a7 100755 --- a/pod_feeder.pl +++ b/pod_feeder.pl @@ -12,7 +12,7 @@ ## for helping me understand how play nice with CSRF tokens et al ## ## You can initialize the database thusly: -## $ echo "CREATE TABLE feeds( guid varchar(255) primary key, feed_id varchar(127), link varchar(255), hashtags varchar(255), timestamp integer(10), posted integer(1) );" | sqlite3 feeds.db +## $ echo "CREATE TABLE feeds( guid varchar(255) primary key, feed_id varchar(127), title varchar(255), link varchar(255), hashtags varchar(255), timestamp integer(10), posted integer(1) );" | sqlite3 feeds.db ## use strict; @@ -136,8 +136,8 @@ sub update_feed { # and if not, insert it unless( defined $row ){ $sth = $dbh->prepare( - "INSERT INTO feeds( guid, feed_id, link, hashtags, posted, timestamp ) \ - VALUES( \"$item->{'guid'}\", \"$feed_id\", \"$item->{'link'}\", \"" . join( ' ', @{$item->{'hashtags'}} ) . '", 0, ' . time . ')' + "INSERT INTO feeds( guid, feed_id, title, link, hashtags, posted, timestamp ) \ + VALUES( \"$item->{'guid'}\", \"$feed_id\", \"$item->{'title'}\", \"$item->{'link'}\", \"" . join( ' ', @{$item->{'hashtags'}} ) . '", 0, ' . time . ')' ) or die "Can't prepare statement: $DBI::errstr"; $sth->execute() or die "Can't execute statement: $DBI::errstr"; }