mirror of
https://gitlab.silvrtree.co.uk/martind2000/rss-braider.git
synced 2025-01-11 03:05:07 +00:00
Re-adding support for categories. Adding support for a kqed:source namespace to indicate the source of an item
This commit is contained in:
parent
8fe8f3a175
commit
5bc5ccbd1e
@ -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"]["#"]){
|
||||
|
Loading…
Reference in New Issue
Block a user