debugging braider
This commit is contained in:
parent
1e395d5278
commit
99478f09bb
15
node_modules/rss-braider/lib/RssBraider.js
generated
vendored
15
node_modules/rss-braider/lib/RssBraider.js
generated
vendored
@ -12,7 +12,7 @@ var FeedParser = require('feedparser'),
|
|||||||
var RssBraider = function (options) {
|
var RssBraider = function (options) {
|
||||||
this.uniques = {};
|
this.uniques = {};
|
||||||
this.mdUniques = [];
|
this.mdUniques = [];
|
||||||
this.feedCount = 0;
|
this.feedCount = [];
|
||||||
if (!options) {
|
if (!options) {
|
||||||
options = {};
|
options = {};
|
||||||
}
|
}
|
||||||
@ -81,8 +81,8 @@ RssBraider.prototype.processFeed = function(feed_name, format, callback)
|
|||||||
// Then process each item/article through rss-braider and any plugins
|
// Then process each item/article through rss-braider and any plugins
|
||||||
async.each(feed.sources, function(source, callback) {
|
async.each(feed.sources, function(source, callback) {
|
||||||
console.log('+ async.each');
|
console.log('+ async.each');
|
||||||
self.feedCount++;
|
self.feedCount.push(source.feed_url);
|
||||||
console.log('## FEED COUNT: ' + self.feedCount);
|
console.log('## FEED COUNT: ' + self.feedCount.length);
|
||||||
var count = source.count || feed.default_count || 10, // Number of articles per source
|
var count = source.count || feed.default_count || 10, // Number of articles per source
|
||||||
url = source.feed_url || null,
|
url = source.feed_url || null,
|
||||||
file_path = source.file_path || null,
|
file_path = source.file_path || null,
|
||||||
@ -152,10 +152,15 @@ RssBraider.prototype.processFeed = function(feed_name, format, callback)
|
|||||||
source_articles = self.date_sort(source_articles);
|
source_articles = self.date_sort(source_articles);
|
||||||
source_articles = source_articles.slice(0, count);
|
source_articles = source_articles.slice(0, count);
|
||||||
feed_articles = feed_articles.concat(source_articles);
|
feed_articles = feed_articles.concat(source_articles);
|
||||||
self.feedCount--;
|
var p = self.feedCount.indexOf(source.feed_url);
|
||||||
console.log('~~ FEED COUNT: ' + self.feedCount);
|
if (p > -1) {
|
||||||
|
self.feedCount.splice(p, 1);
|
||||||
|
}
|
||||||
|
console.log('~~ FEED COUNT: ' + self.feedCount.length);
|
||||||
|
console.log(self.feedCount);
|
||||||
callback();
|
callback();
|
||||||
console.log('- end');
|
console.log('- end');
|
||||||
|
|
||||||
});
|
});
|
||||||
console.log('- async.each');
|
console.log('- async.each');
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user