mirror of
https://gitlab.silvrtree.co.uk/martind2000/rss-braider.git
synced 2025-02-11 11:09:17 +00:00
RSS-28: Moving plugs to examples and updating unit tests
This commit is contained in:
parent
72971c5c33
commit
a94cd4907c
@ -5,7 +5,8 @@ feed_obj.filefeed = require("./config/feed_with_plugins").feed;
|
|||||||
|
|
||||||
var braider_options = {
|
var braider_options = {
|
||||||
feeds : feed_obj,
|
feeds : feed_obj,
|
||||||
indent : " "
|
indent : " ",
|
||||||
|
plugins_directories : [__dirname + "/plugins/"]
|
||||||
};
|
};
|
||||||
var rss_braider = RssBraider.createClient(braider_options);
|
var rss_braider = RssBraider.createClient(braider_options);
|
||||||
|
|
||||||
|
20
lib/example_plugins/content_encoded.js
Normal file
20
lib/example_plugins/content_encoded.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// Put the description into content:encoded block
|
||||||
|
// Ex:
|
||||||
|
// <content:encoded>
|
||||||
|
// <![CDATA[<p>Stewart let the news slip during a taping of his show today.]]>
|
||||||
|
// </content:encoded>
|
||||||
|
module.exports = function (item, itemOptions, source) {
|
||||||
|
if (!item || !itemOptions) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (item["content:encoded"] && item["content:encoded"]["#"]){
|
||||||
|
var content_encoded = item["content:encoded"]["#"];
|
||||||
|
itemOptions.custom_elements.push(
|
||||||
|
{ "content:encoded":
|
||||||
|
{
|
||||||
|
_cdata: content_encoded
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
@ -35,7 +35,7 @@ test('braid feed from file with plugins', function(t) {
|
|||||||
feeds : feeds,
|
feeds : feeds,
|
||||||
indent : " ",
|
indent : " ",
|
||||||
date_sort_order : "desc",
|
date_sort_order : "desc",
|
||||||
plugins_directories : [__dirname + '/../lib/plugins/']
|
plugins_directories : [__dirname + '/../lib/example_plugins/']
|
||||||
};
|
};
|
||||||
var rss_braider = RssBraider.createClient(braider_options);
|
var rss_braider = RssBraider.createClient(braider_options);
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ test('deduplicate feed from file', function(t) {
|
|||||||
feeds : feeds,
|
feeds : feeds,
|
||||||
indent : " ",
|
indent : " ",
|
||||||
dedupe_fields : ["title", "guid"],
|
dedupe_fields : ["title", "guid"],
|
||||||
plugins_directories : [__dirname + '/../lib/plugins/']
|
plugins_directories : [__dirname + '/../lib/example_plugins/']
|
||||||
};
|
};
|
||||||
var rss_braider = RssBraider.createClient(braider_options);
|
var rss_braider = RssBraider.createClient(braider_options);
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ test('sort by date desc', function(t) {
|
|||||||
feeds : feeds,
|
feeds : feeds,
|
||||||
indent : " ",
|
indent : " ",
|
||||||
date_sort_order : "desc",
|
date_sort_order : "desc",
|
||||||
plugins_directories : [__dirname + '/../lib/plugins/']
|
plugins_directories : [__dirname + '/../lib/example_plugins/']
|
||||||
};
|
};
|
||||||
var rss_braider = RssBraider.createClient(braider_options);
|
var rss_braider = RssBraider.createClient(braider_options);
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ test('sort by date asc', function(t) {
|
|||||||
feeds : feeds,
|
feeds : feeds,
|
||||||
indent : " ",
|
indent : " ",
|
||||||
date_sort_order : "asc",
|
date_sort_order : "asc",
|
||||||
plugins_directories : [__dirname + '/../lib/plugins/']
|
plugins_directories : [__dirname + '/../lib/example_plugins/']
|
||||||
};
|
};
|
||||||
var rss_braider = RssBraider.createClient(braider_options);
|
var rss_braider = RssBraider.createClient(braider_options);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user