debugging

This commit is contained in:
Martin Donnelly 2015-07-31 12:52:59 +01:00
parent 0a79c9611a
commit 46be1be729

View File

@ -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();
});
},