diff --git a/node_modules/rss-braider/lib/RssBraider.js b/node_modules/rss-braider/lib/RssBraider.js index eb8c2c6..1af75e4 100644 --- a/node_modules/rss-braider/lib/RssBraider.js +++ b/node_modules/rss-braider/lib/RssBraider.js @@ -10,6 +10,7 @@ var FeedParser = require('feedparser'), logger; var RssBraider = function (options) { + this.feedCount = []; if (!options) { options = {}; } @@ -77,6 +78,8 @@ RssBraider.prototype.processFeed = function(feed_name, format, callback) // Process each feed source through Feedparser to get articles. // Then process each item/article through rss-braider and any plugins async.each(feed.sources, function(source, callback) { + self.feedCount.push(source.feed_url); + console.log('## FEED COUNT: ' + self.feedCount.length); var count = source.count || feed.default_count || 10, // Number of articles per source url = source.feed_url || null, file_path = source.file_path || null, @@ -135,6 +138,12 @@ RssBraider.prototype.processFeed = function(feed_name, format, callback) source_articles = self.date_sort(source_articles); source_articles = source_articles.slice(0, count); feed_articles = feed_articles.concat(source_articles); + var p = self.feedCount.indexOf(source.feed_url); + if (p > -1) { + self.feedCount.splice(p, 1); + } + console.log('~~ FEED COUNT: ' + self.feedCount.length); + console.log(self.feedCount); callback(); }); },