Merge branch 'develop' into toot-digest
commit
5b48172342
|
@ -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);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"mysql": {
|
||||
"host": "mysql.example.com",
|
||||
"database": "rsstootalizer_production",
|
||||
"database": "rsstootalizer_development",
|
||||
"user": "rsstootalizer",
|
||||
"pass": "secret123"
|
||||
},
|
||||
|
|
|
@ -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 = "";
|
||||
|
|
Loading…
Reference in New Issue