Re-adding support for categories. Adding support for a kqed:source namespace to indicate the source of an item

This commit is contained in:
Kip Gebhardt 2014-12-29 16:35:56 -08:00
parent 8fe8f3a175
commit 5bc5ccbd1e

View File

@ -88,6 +88,8 @@ RssBraider.prototype.processFeed = function(feed_name, format, callback)
while ( item = stream.read() ) {
// logger.info("item received", item.guid);
// Set kqed source
item["kqed:source"] = source.url;
var article = self.processItem(item);
if (article) {
source_articles.push(article);
@ -142,8 +144,6 @@ RssBraider.prototype.processFeed = function(feed_name, format, callback)
ret_string = "{}";
}
// DEBUG
console.timeEnd("process");
return callback(null, ret_string);
}
});
@ -164,15 +164,21 @@ RssBraider.prototype.processItem = function (item) {
permalink : item.permalink,
author : item.author,
date : item.date,
categories : item.categories,
custom_elements : []
};
//////////////////
// Custom elements PLUGINS
// Custom elements Move to PLUGINS
//////////////////
// TODO: Generify the following if possible
// kqed source
if (item['kqed:source']) {
itemOptions.custom_elements.push(
{ 'kqed:source': item['kqed:source'] }
);
}
// content:encoded (i.e. description)
if (item["content:encoded"] && item["content:encoded"]["#"]){