debugging
This commit is contained in:
parent
0a79c9611a
commit
46be1be729
9
node_modules/rss-braider/lib/RssBraider.js
generated
vendored
9
node_modules/rss-braider/lib/RssBraider.js
generated
vendored
@ -10,6 +10,7 @@ var FeedParser = require('feedparser'),
|
|||||||
logger;
|
logger;
|
||||||
|
|
||||||
var RssBraider = function (options) {
|
var RssBraider = function (options) {
|
||||||
|
this.feedCount = [];
|
||||||
if (!options) {
|
if (!options) {
|
||||||
options = {};
|
options = {};
|
||||||
}
|
}
|
||||||
@ -77,6 +78,8 @@ RssBraider.prototype.processFeed = function(feed_name, format, callback)
|
|||||||
// Process each feed source through Feedparser to get articles.
|
// Process each feed source through Feedparser to get articles.
|
||||||
// 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) {
|
||||||
|
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
|
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,
|
||||||
@ -135,6 +138,12 @@ 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);
|
||||||
|
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();
|
callback();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user