This commit is contained in:
Kip Gebhardt 2014-12-23 15:52:58 -08:00
parent 0b9023f45e
commit a66dc32d25

View File

@ -33,6 +33,7 @@ RssBraider.prototype.feedExists = function (feed_name) {
RssBraider.prototype.processFeed = function(feed_name, format, callback)
{
// DEBUG
console.time("process");
if (!format) {
@ -96,11 +97,8 @@ RssBraider.prototype.processFeed = function(feed_name, format, callback)
function(err){
if (err) {
logger.error(err);
return callback(err);
} else {
// all done
logger.info(feed_articles);
// Sort the stories for the source by date descending
feed_articles = self.dedupe(feed_articles);
feed_articles = self.date_sort(feed_articles);
@ -125,17 +123,19 @@ RssBraider.prototype.processFeed = function(feed_name, format, callback)
case 'json':
ret_string = JSON.stringify(newfeed);
break;
case 'rss':
case 'xml':
ret_string = newfeed.xml("\t");
break;
default:
logger.error("Unknown format:", format);
ret_string = "{}";
}
console.timeEnd("process");
console.log(format, ret_string);
callback(null, ret_string);
// return ret_string;
// DEBUG
console.timeEnd("process");
return callback(null, ret_string);
}
});
@ -147,9 +147,6 @@ RssBraider.prototype.processItem = function (item) {
logger.error("processItem: no item passed in");
return null;
}
// logger.info("item", item);
// Basics
var itemOptions = {
title : item.title,
@ -164,7 +161,7 @@ RssBraider.prototype.processItem = function (item) {
//////////////////
// Custom elements
// Custom elements PLUGINS
//////////////////
// TODO: Generify the following if possible