Merge branch 'develop' into toot-digest

develop
mj-saunders 2018-05-05 08:07:54 +00:00
commit 5b48172342
3 changed files with 6 additions and 2 deletions

View File

@ -41,12 +41,16 @@ if ($VERBOSE) {print STDOUT "Checking for new entries\n";}
my $new_entries = 0;
my @feeds = RSSTootalizer::Feed->all();
# For each Feed stored in database
FEED: foreach my $feed (@feeds){
next FEED unless $feed;
next FEED unless $feed->{data}->{enabled};
# If enabled, fetch the RSS xml
my $entries = $feed->fetch_entries();
next FEED unless $entries;
# For each entry in the xml file
ENTRY: foreach my $entry ($entries->items){
# Does the entry already exist in the database?
my @seen_entries = $feed->entry_by("entry_link", $entry->link());
next ENTRY if ((scalar @seen_entries) > 0);

View File

@ -1,7 +1,7 @@
{
"mysql": {
"host": "mysql.example.com",
"database": "rsstootalizer_production",
"database": "rsstootalizer_development",
"user": "rsstootalizer",
"pass": "secret123"
},

View File

@ -27,7 +27,7 @@ binmode STDOUT, ":utf8";
my @migrations = glob ("migrations/*sql");
foreach my $migration (@migrations){
my $sth = RSSTootalizer::DB->doSELECT("SELECT * FROM migrations WHERE name = ?", $migration);
if (scalar(@$sth) == 0){
if ( scalar(@$sth) == 0 ){
print "Running migration $migration\n";
open (M, "<", $migration);
my $sql = "";