mirror of
https://gitlab.silvrtree.co.uk/martind2000/rss-braider.git
synced 2025-03-11 07:19:59 +00:00
Cleanup
This commit is contained in:
parent
0b9023f45e
commit
a66dc32d25
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user