tidied feeds a bit and fixed fit
This commit is contained in:
parent
ea081ddac2
commit
e79a0132f3
File diff suppressed because it is too large
Load Diff
85
bare-news.js
Normal file
85
bare-news.js
Normal file
@ -0,0 +1,85 @@
|
||||
var outputFile = 'news', RssBraider = require('rss-braider'), fs = require('fs'), ejs = require(
|
||||
'ejs'), read = require('fs').readFileSync, join = require('path').join, str = read(
|
||||
join(__dirname, '/templates/rss.ejs'),
|
||||
'utf8'), feeds = {};
|
||||
|
||||
var log4js = require('log4js');
|
||||
var logger = log4js.getLogger();
|
||||
|
||||
// Pull feeds from config files: ,
|
||||
// feeds.simple_test_feed = require("./config/feed").feed;
|
||||
// Or define in-line
|
||||
|
||||
// filters 'filter_3_days', 'fix_images', 'fix_scripts'
|
||||
feeds.simple_test_feed = {
|
||||
"feed_name": "feed",
|
||||
"default_count": 1,
|
||||
"no_cdata_fields": [], // Don't wrap these fields in CDATA tags
|
||||
"meta": {
|
||||
"title": "News",
|
||||
"description": "Combined News Feed",
|
||||
'site_url': 'http://pipes.silvrtree.co.uk/news.xml'
|
||||
},
|
||||
"plugins": [
|
||||
'filter_3_days', 'fix_images', 'fix_scripts'
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"count": 100,
|
||||
"feed_url": "http://www.telegraph.co.uk/news/rss.xml"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
;
|
||||
var braider_options = {
|
||||
feeds: feeds,
|
||||
indent: " ",
|
||||
date_sort_order: "desc", // Newest first
|
||||
log_level: "warn",
|
||||
dedupe_fields: ['link', 'guid'],
|
||||
plugins_directories: [__dirname + "/plugins/"]
|
||||
};
|
||||
var rss_braider = RssBraider.createClient(braider_options);
|
||||
|
||||
// Override logging level (debug, info, warn, err, off)
|
||||
//rss_braider.logger.level('off');
|
||||
|
||||
rss_braider.processFeed('simple_test_feed', 'json', function(err, data) {
|
||||
console.log('A');
|
||||
if (err) {
|
||||
logger.error(err);
|
||||
return err;
|
||||
}
|
||||
|
||||
console.log('B');
|
||||
|
||||
var j = JSON.parse(data);
|
||||
|
||||
console.log('C');
|
||||
var ejsOutput = ejs.compile(str)(j);
|
||||
|
||||
console.log('D');
|
||||
fs.writeFile(__dirname + "/dist/" + outputFile + ".html",
|
||||
ejsOutput,
|
||||
function(err) {
|
||||
|
||||
if (err) {
|
||||
logger.error(err);
|
||||
return console.error(err);
|
||||
}
|
||||
|
||||
console.log("The file was saved!");
|
||||
});
|
||||
|
||||
fs.writeFile(__dirname + "/dist/" + outputFile + ".json",
|
||||
data,
|
||||
function(err) {
|
||||
if (err) {
|
||||
logger.error(err);
|
||||
return console.error(err);
|
||||
}
|
||||
|
||||
console.log("The file was saved!");
|
||||
});
|
||||
});
|
49
fit.js
49
fit.js
@ -6,20 +6,43 @@ var outputFile = 'fit', RssBraider = require('rss-braider'), fs = require('fs'),
|
||||
// Pull feeds from config files: ,
|
||||
// feeds.simple_test_feed = require("./config/feed").feed;
|
||||
// Or define in-line
|
||||
|
||||
// filters
|
||||
|
||||
// 'filter_last_week', 'fix_images', 'fix_scripts'
|
||||
|
||||
|
||||
feeds.simple_test_feed = {
|
||||
"feed_name": "feed", "default_count": 1, "no_cdata_fields": [], // Don't wrap these fields in CDATA tags
|
||||
"feed_name": "feed", "default_count": 1, "no_cdata_fields" : ['description'], // Don't wrap these fields in CDATA tags
|
||||
"meta": {
|
||||
"title": "Fitness",
|
||||
"description": "Combined Fitness Feed",
|
||||
'site_url': 'http://pipes.silvrtree.co.uk/fit.xml'
|
||||
}, "plugins": ['filter_last_week', 'fix_images', 'fix_scripts'], "sources": [
|
||||
}, "plugins": ['filter_last_week', 'fix_images', 'fix_scripts'],
|
||||
|
||||
'custom_namespaces' : {
|
||||
"content" : "http://purl.org/rss/1.0/modules/content/",
|
||||
"slash" : "http://purl.org/rss/1.0/modules/slash/",
|
||||
"media" : "http://search.yahoo.com/mrss/",
|
||||
"ev" : "http://purl.org/rss/2.0/modules/event/",
|
||||
"sy" : "http://purl.org/rss/1.0/modules/syndication/",
|
||||
"wfw" : "http://wellformedweb.org/CommentAPI/",
|
||||
"dc" : "http://purl.org/dc/elements/1.1/",
|
||||
"atom" : "http://www.w3.org/2005/Atom"
|
||||
},
|
||||
|
||||
"sources": [
|
||||
{
|
||||
|
||||
"count": 100, "feed_url": "http://www.mensfitness.co.uk/feeds/all"
|
||||
}, {
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
"count": 100, "feed_url": "http://www.coachmag.co.uk/feeds/all"
|
||||
}, {
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
"count": 100, "feed_url": "http://muscleandbrawn.com/feed/"
|
||||
},
|
||||
@ -34,25 +57,21 @@ feeds.simple_test_feed = {
|
||||
"count": 100, "feed_url": "http://www.simplyshredded.com/feed"
|
||||
},
|
||||
|
||||
{
|
||||
/* {
|
||||
|
||||
"count": 100, "feed_url": "http://www.gym-talk.com/feed/"
|
||||
},
|
||||
"count": 100, "feed_url": "http://www.gym-talk.com/feed"
|
||||
},*/
|
||||
|
||||
{
|
||||
|
||||
"count": 100, "feed_url": "http://www.bornfitness.com/feed/"
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
"count": 100, "feed_url": "http://breakingmuscle.com/uk/feed/rss"
|
||||
},
|
||||
/*{
|
||||
|
||||
{
|
||||
|
||||
"count": 100, "feed_url": "http://breakingmuscle.com/uk/feed/wod.xml"
|
||||
},
|
||||
"count": 100, "feed_url": "http://breakingmuscle.co.uk/uk/feed/rss"
|
||||
},*/
|
||||
|
||||
{
|
||||
|
||||
@ -75,7 +94,7 @@ var braider_options = {
|
||||
feeds: feeds,
|
||||
indent: " ",
|
||||
date_sort_order: "desc", // Newest first
|
||||
log_level: "warn",
|
||||
log_level: "debug",
|
||||
dedupe_fields: ['link', 'guid'],
|
||||
plugins_directories: [__dirname + "/plugins/"]
|
||||
};
|
||||
|
18
news.js
18
news.js
@ -13,7 +13,7 @@ var logger = log4js.getLogger();
|
||||
feeds.simple_test_feed = {
|
||||
"feed_name": "feed",
|
||||
"default_count": 1,
|
||||
"no_cdata_fields": [], // Don't wrap these fields in CDATA tags
|
||||
"no_cdata_fields": ['description'], // Don't wrap these fields in CDATA tags
|
||||
"meta": {
|
||||
"title": "News",
|
||||
"description": "Combined News Feed",
|
||||
@ -22,6 +22,16 @@ feeds.simple_test_feed = {
|
||||
"plugins": [
|
||||
'filter_3_days', 'fix_images', 'fix_scripts'
|
||||
],
|
||||
'custom_namespaces' : {
|
||||
"content" : "http://purl.org/rss/1.0/modules/content/",
|
||||
"slash" : "http://purl.org/rss/1.0/modules/slash/",
|
||||
"media" : "http://search.yahoo.com/mrss/",
|
||||
"ev" : "http://purl.org/rss/2.0/modules/event/",
|
||||
"sy" : "http://purl.org/rss/1.0/modules/syndication/",
|
||||
"wfw" : "http://wellformedweb.org/CommentAPI/",
|
||||
"dc" : "http://purl.org/dc/elements/1.1/",
|
||||
"atom" : "http://www.w3.org/2005/Atom"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"count": 100,
|
||||
@ -91,11 +101,7 @@ feeds.simple_test_feed = {
|
||||
},
|
||||
{
|
||||
"count": 100,
|
||||
"feed_url": "http://www.telegraph.co.uk/newsfeed/rss/news-uk_news.xml"
|
||||
},
|
||||
{
|
||||
"count": 100,
|
||||
"feed_url": "http://www.telegraph.co.uk/news/worldnews/rss"
|
||||
"feed_url": "http://www.telegraph.co.uk/news/rss.xml"
|
||||
},
|
||||
{
|
||||
"count": 100,
|
||||
|
1
node_modules/ejs/Jakefile
generated
vendored
1
node_modules/ejs/Jakefile
generated
vendored
@ -34,6 +34,7 @@ publishTask('ejs', ['build'], function () {
|
||||
this.packageFiles.include([
|
||||
'Jakefile'
|
||||
, 'README.md'
|
||||
, 'LICENSE'
|
||||
, 'package.json'
|
||||
, 'ejs.js'
|
||||
, 'ejs.min.js'
|
||||
|
80
node_modules/ejs/README.md
generated
vendored
80
node_modules/ejs/README.md
generated
vendored
@ -14,7 +14,7 @@ $ npm install ejs
|
||||
## Features
|
||||
|
||||
* Control flow with `<% %>`
|
||||
* Escaped output with `<%= %>`
|
||||
* Escaped output with `<%= %>` (escape function configurable)
|
||||
* Unescaped raw output with `<%- %>`
|
||||
* Newline-trim mode ('newline slurping') with `-%>` ending tag
|
||||
* Whitespace-trim mode (slurp all whitespace) for control flow with `<%_ _%>`
|
||||
@ -42,19 +42,28 @@ template(data);
|
||||
|
||||
ejs.render(str, data, options);
|
||||
// => Rendered HTML string
|
||||
|
||||
ejs.renderFile(filename, data, options, function(err, str){
|
||||
// str => Rendered HTML string
|
||||
});
|
||||
```
|
||||
|
||||
You can also use the shortcut `ejs.render(dataAndOptions);` where you pass
|
||||
It is also possible to use `ejs.render(dataAndOptions);` where you pass
|
||||
everything in a single object. In that case, you'll end up with local variables
|
||||
for all the passed options.
|
||||
for all the passed options. However, be aware that your code could break if we
|
||||
add an option with the same name as one of your data object's properties.
|
||||
Therefore, we do not recommend using this shortcut.
|
||||
|
||||
## Options
|
||||
|
||||
- `cache` Compiled functions are cached, requires `filename`
|
||||
- `filename` Used by `cache` to key caches, and for includes
|
||||
- `filename` The name of the file being rendered. Not required if you
|
||||
are using `renderFile()`. Used by `cache` to key caches, and for includes.
|
||||
- `context` Function execution context
|
||||
- `compileDebug` When `false` no debug instrumentation is compiled
|
||||
- `client` Returns standalone compiled function
|
||||
- `client` When `true`, compiles a function that can be rendered
|
||||
in the browser without needing to load the EJS Runtime
|
||||
([ejs.min.js](https://github.com/mde/ejs/releases/latest)).
|
||||
- `delimiter` Character to use with angle brackets for open/close
|
||||
- `debug` Output generated function body
|
||||
- `strict` When set to `true`, generated function is in strict mode
|
||||
@ -64,23 +73,37 @@ for all the passed options.
|
||||
and trailing whitespace. It also enables a safer version of `-%>` line
|
||||
slurping for all scriptlet tags (it does not strip new lines of tags in
|
||||
the middle of a line).
|
||||
- `escape` The escaping function used with `<%=` construct. It is
|
||||
used in rendering and is `.toString()`ed in the generation of client functions. (By default escapes XML).
|
||||
|
||||
This project uses [JSDoc](http://usejsdoc.org/). For the full public API
|
||||
documentation, clone the repository and run `npm run doc`. This will run JSDoc
|
||||
with the proper options and output the documentation to `out/`. If you want
|
||||
the both the public & private API docs, run `npm run devdoc` instead.
|
||||
|
||||
## Tags
|
||||
|
||||
- `<%` 'Scriptlet' tag, for control-flow, no output
|
||||
- `<%=` Outputs the value into the template (HTML escaped)
|
||||
- `<%_` 'Whitespace Slurping' Scriptlet tag, strips all whitespace before it
|
||||
- `<%=` Outputs the value into the template (escaped)
|
||||
- `<%-` Outputs the unescaped value into the template
|
||||
- `<%#` Comment tag, no execution, no output
|
||||
- `<%%` Outputs a literal '<%'
|
||||
- `%>` Plain ending tag
|
||||
- `-%>` Trim-mode ('newline slurp') tag, trims following newline
|
||||
- `_%>` 'Whitespace Slurping' ending tag, removes all whitespace after it
|
||||
|
||||
For the full syntax documentation, please see [docs/syntax.md](https://github.com/mde/ejs/blob/master/docs/syntax.md).
|
||||
|
||||
## Includes
|
||||
|
||||
Includes either have to be an absolute path, or, if not, are assumed as
|
||||
relative to the template with the `include` call. (This requires the
|
||||
`filename` option.) For example if you are including `./views/user/show.ejs`
|
||||
from `./views/users.ejs` you would use `<%- include('user/show') %>`.
|
||||
relative to the template with the `include` call. For example if you are
|
||||
including `./views/user/show.ejs` from `./views/users.ejs` you would
|
||||
use `<%- include('user/show') %>`.
|
||||
|
||||
You must specify the `filename` option for the template with the `include`
|
||||
call unless you are using `renderFile()`.
|
||||
|
||||
You'll likely want to use the raw output tag (`<%-`) with your include to avoid
|
||||
double-escaping the HTML output.
|
||||
@ -155,9 +178,44 @@ including headers and footers, like so:
|
||||
## Client-side support
|
||||
|
||||
Go to the [Latest Release](https://github.com/mde/ejs/releases/latest), download
|
||||
`./ejs.js` or `./ejs.min.js`.
|
||||
`./ejs.js` or `./ejs.min.js`. Alternately, you can compile it yourself by cloning
|
||||
the repository and running `jake build` (or `$(npm bin)/jake build` if jake is
|
||||
not installed globally).
|
||||
|
||||
Include one of these on your page, and `ejs.render(str)`.
|
||||
Include one of these files on your page, and `ejs` should be available globally.
|
||||
|
||||
### Example
|
||||
|
||||
```html
|
||||
<div id="output"></div>
|
||||
<script src="ejs.min.js"></script>
|
||||
<script>
|
||||
var people = ['geddy', 'neil', 'alex'],
|
||||
html = ejs.render('<%= people.join(", "); %>', {people: people});
|
||||
// With jQuery:
|
||||
$('#output').html(html);
|
||||
// Vanilla JS:
|
||||
document.getElementById('output').innerHTML = html;
|
||||
</script>
|
||||
```
|
||||
|
||||
### Caveats
|
||||
|
||||
Most of EJS will work as expected; however, there are a few things to note:
|
||||
|
||||
1. Obviously, since you do not have access to the filesystem, `ejs.renderFile()` won't work.
|
||||
2. For the same reason, `include`s do not work unless you use an `IncludeCallback`. Here is an example:
|
||||
```javascript
|
||||
var str = "Hello <%= include('file', {person: 'John'}); %>",
|
||||
fn = ejs.compile(str, {client: true});
|
||||
|
||||
fn(data, null, function(path, d){ // IncludeCallback
|
||||
// path -> 'file'
|
||||
// d -> {person: 'John'}
|
||||
// Put your code here
|
||||
// Return the contents of file as a string
|
||||
}); // returns rendered string
|
||||
```
|
||||
|
||||
## Related projects
|
||||
|
||||
|
15
node_modules/ejs/ejs.js
generated
vendored
15
node_modules/ejs/ejs.js
generated
vendored
@ -524,6 +524,10 @@ Template.prototype = {
|
||||
, d = this.opts.delimiter;
|
||||
|
||||
if (matches && matches.length) {
|
||||
if (this.opts.compileDebug && this.opts.filename) {
|
||||
this.source = ' ; __lines = ' + JSON.stringify(this.templateText) + '\n';
|
||||
this.source += ' ; __filename = "' + this.opts.filename.replace(/\\/g, '/') + '"\n';
|
||||
}
|
||||
matches.forEach(function (line, index) {
|
||||
var opening
|
||||
, closing
|
||||
@ -708,6 +712,12 @@ Template.prototype = {
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* Export the internal function for escaping XML so people
|
||||
* can use for manual escaping if needed
|
||||
* */
|
||||
exports.escapeXML = utils.escapeXML;
|
||||
|
||||
/**
|
||||
* Express.js support.
|
||||
*
|
||||
@ -1159,6 +1169,7 @@ process.browser = true;
|
||||
process.env = {};
|
||||
process.argv = [];
|
||||
process.version = ''; // empty string to avoid regexp issues
|
||||
process.versions = {};
|
||||
|
||||
function noop() {}
|
||||
|
||||
@ -1190,7 +1201,7 @@ module.exports={
|
||||
"engine",
|
||||
"ejs"
|
||||
],
|
||||
"version": "2.4.0",
|
||||
"version": "2.4.1",
|
||||
"author": "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)",
|
||||
"contributors": [
|
||||
"Timothy Gu <timothygu99@gmail.com> (https://timothygu.github.io)"
|
||||
@ -1219,10 +1230,10 @@ module.exports={
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha",
|
||||
"sample": "npm install express && node sample/index.js",
|
||||
"coverage": "istanbul cover node_modules/mocha/bin/_mocha",
|
||||
"doc": "rimraf out && jsdoc -c jsdoc.json lib/* docs/jsdoc/*",
|
||||
"devdoc": "rimraf out && jsdoc -p -c jsdoc.json lib/* docs/jsdoc/*"
|
||||
}
|
||||
}
|
||||
|
||||
},{}]},{},[1]);
|
||||
|
2
node_modules/ejs/ejs.min.js
generated
vendored
2
node_modules/ejs/ejs.min.js
generated
vendored
File diff suppressed because one or more lines are too long
10
node_modules/ejs/lib/ejs.js
generated
vendored
10
node_modules/ejs/lib/ejs.js
generated
vendored
@ -523,6 +523,10 @@ Template.prototype = {
|
||||
, d = this.opts.delimiter;
|
||||
|
||||
if (matches && matches.length) {
|
||||
if (this.opts.compileDebug && this.opts.filename) {
|
||||
this.source = ' ; __lines = ' + JSON.stringify(this.templateText) + '\n';
|
||||
this.source += ' ; __filename = "' + this.opts.filename.replace(/\\/g, '/') + '"\n';
|
||||
}
|
||||
matches.forEach(function (line, index) {
|
||||
var opening
|
||||
, closing
|
||||
@ -707,6 +711,12 @@ Template.prototype = {
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* Export the internal function for escaping XML so people
|
||||
* can use for manual escaping if needed
|
||||
* */
|
||||
exports.escapeXML = utils.escapeXML;
|
||||
|
||||
/**
|
||||
* Express.js support.
|
||||
*
|
||||
|
25
node_modules/ejs/package.json
generated
vendored
25
node_modules/ejs/package.json
generated
vendored
@ -2,20 +2,24 @@
|
||||
"_args": [
|
||||
[
|
||||
"ejs@*",
|
||||
"C:\\mddev\\rinser"
|
||||
"/Users/martin/newdev/Rinser"
|
||||
]
|
||||
],
|
||||
"_from": "ejs@*",
|
||||
"_id": "ejs@2.4.1",
|
||||
"_id": "ejs@2.4.2",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/ejs",
|
||||
"_nodeVersion": "0.12.4",
|
||||
"_nodeVersion": "4.4.4",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/ejs-2.4.2.tgz_1464117640663_0.8193834638223052"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "mde@fleegix.org",
|
||||
"name": "mde"
|
||||
},
|
||||
"_npmVersion": "2.10.1",
|
||||
"_npmVersion": "2.15.1",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "ejs",
|
||||
@ -28,11 +32,11 @@
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ejs/-/ejs-2.4.1.tgz",
|
||||
"_shasum": "82e15b1b2a1f948b18097476ba2bd7c66f4d1566",
|
||||
"_resolved": "http://registry.npmjs.org/ejs/-/ejs-2.4.2.tgz",
|
||||
"_shasum": "7057eb4812958fb731841cd9ca353343efe597b1",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "ejs@*",
|
||||
"_where": "C:\\mddev\\rinser",
|
||||
"_where": "/Users/martin/newdev/Rinser",
|
||||
"author": {
|
||||
"email": "mde@fleegix.org",
|
||||
"name": "Matthew Eernisse",
|
||||
@ -62,8 +66,8 @@
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "82e15b1b2a1f948b18097476ba2bd7c66f4d1566",
|
||||
"tarball": "http://registry.npmjs.org/ejs/-/ejs-2.4.1.tgz"
|
||||
"shasum": "7057eb4812958fb731841cd9ca353343efe597b1",
|
||||
"tarball": "https://registry.npmjs.org/ejs/-/ejs-2.4.2.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
@ -97,7 +101,8 @@
|
||||
"coverage": "istanbul cover node_modules/mocha/bin/_mocha",
|
||||
"devdoc": "rimraf out && jsdoc -p -c jsdoc.json lib/* docs/jsdoc/*",
|
||||
"doc": "rimraf out && jsdoc -c jsdoc.json lib/* docs/jsdoc/*",
|
||||
"sample": "npm install express && node sample/index.js",
|
||||
"test": "mocha"
|
||||
},
|
||||
"version": "2.4.1"
|
||||
"version": "2.4.2"
|
||||
}
|
||||
|
38
node_modules/ejs/test/ejs.js
generated
vendored
38
node_modules/ejs/test/ejs.js
generated
vendored
@ -135,6 +135,32 @@ suite('ejs.compile(str, options)', function () {
|
||||
// There could be a `rethrow` in the function declaration
|
||||
assert((fn.toString().match(/rethrow/g) || []).length <= 1);
|
||||
});
|
||||
|
||||
test('support custom escape function', function () {
|
||||
var customEscape
|
||||
, fn;
|
||||
customEscape = function customEscape(str) {
|
||||
return !str ? '' : str.toUpperCase();
|
||||
};
|
||||
fn = ejs.compile('HELLO <%= name %>', {escape: customEscape});
|
||||
assert.equal(fn({name: 'world'}), 'HELLO WORLD');
|
||||
});
|
||||
|
||||
test('support custom escape function in client mode', function () {
|
||||
var customEscape
|
||||
, fn
|
||||
, str;
|
||||
customEscape = function customEscape(str) {
|
||||
return !str ? '' : str.toUpperCase();
|
||||
};
|
||||
fn = ejs.compile('HELLO <%= name %>', {escape: customEscape, client: true});
|
||||
str = fn.toString();
|
||||
if (!process.env.running_under_istanbul) {
|
||||
eval('var preFn = ' + str);
|
||||
assert.equal(preFn({name: 'world'}), 'HELLO WORLD');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
suite('ejs.render(str, data, opts)', function () {
|
||||
@ -460,6 +486,18 @@ suite('<%=', function () {
|
||||
assert.equal(ejs.render('<%= name %>', {name: '&foo_bar;'}),
|
||||
'&foo_bar;');
|
||||
});
|
||||
|
||||
test('should accept custom function', function() {
|
||||
|
||||
var customEscape = function customEscape(str) {
|
||||
return !str ? '' : str.toUpperCase();
|
||||
};
|
||||
|
||||
assert.equal(
|
||||
ejs.render('<%= name %>', {name: 'The Jones\'s'}, {escape: customEscape}),
|
||||
'THE JONES\'S'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
suite('<%-', function () {
|
||||
|
1
node_modules/ejs/test/tmp/include.ejs
generated
vendored
1
node_modules/ejs/test/tmp/include.ejs
generated
vendored
@ -1 +0,0 @@
|
||||
<p>New</p>
|
1
node_modules/ejs/test/tmp/include_preprocessor.ejs
generated
vendored
1
node_modules/ejs/test/tmp/include_preprocessor.ejs
generated
vendored
@ -1 +0,0 @@
|
||||
<p>New</p>
|
1
node_modules/ejs/test/tmp/renderFile.ejs
generated
vendored
1
node_modules/ejs/test/tmp/renderFile.ejs
generated
vendored
@ -1 +0,0 @@
|
||||
<p>New</p>
|
10
node_modules/express/package.json
generated
vendored
10
node_modules/express/package.json
generated
vendored
@ -2,7 +2,7 @@
|
||||
"_args": [
|
||||
[
|
||||
"express@^4.13.4",
|
||||
"C:\\mddev\\rinser"
|
||||
"/Users/martin/newdev/Rinser"
|
||||
]
|
||||
],
|
||||
"_from": "express@>=4.13.4 <5.0.0",
|
||||
@ -16,7 +16,7 @@
|
||||
},
|
||||
"_npmVersion": "1.4.28",
|
||||
"_phantomChildren": {
|
||||
"mime-types": "2.1.10"
|
||||
"mime-types": "2.1.11"
|
||||
},
|
||||
"_requested": {
|
||||
"name": "express",
|
||||
@ -29,11 +29,11 @@
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/express/-/express-4.13.4.tgz",
|
||||
"_resolved": "http://registry.npmjs.org/express/-/express-4.13.4.tgz",
|
||||
"_shasum": "3c0b76f3c77590c8345739061ec0bd3ba067ec24",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "express@^4.13.4",
|
||||
"_where": "C:\\mddev\\rinser",
|
||||
"_where": "/Users/martin/newdev/Rinser",
|
||||
"author": {
|
||||
"email": "tj@vision-media.ca",
|
||||
"name": "TJ Holowaychuk"
|
||||
@ -121,7 +121,7 @@
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "3c0b76f3c77590c8345739061ec0bd3ba067ec24",
|
||||
"tarball": "http://registry.npmjs.org/express/-/express-4.13.4.tgz"
|
||||
"tarball": "https://registry.npmjs.org/express/-/express-4.13.4.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10.0"
|
||||
|
8
node_modules/lodash/README.md
generated
vendored
8
node_modules/lodash/README.md
generated
vendored
@ -1,4 +1,4 @@
|
||||
# lodash v4.11.1
|
||||
# lodash v4.13.1
|
||||
|
||||
The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules.
|
||||
|
||||
@ -28,13 +28,13 @@ var chunk = require('lodash/chunk');
|
||||
var extend = require('lodash/fp/extend');
|
||||
```
|
||||
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.11.1-npm) for more details.
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.13.1-npm) for more details.
|
||||
|
||||
**Note:**<br>
|
||||
Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.<br>
|
||||
Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` in the Node.js < 6 REPL.<br>
|
||||
Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes `lodash` by default.
|
||||
|
||||
## Support
|
||||
|
||||
Tested in Chrome 48-49, Firefox 44-45, IE 9-11, Edge 13, Safari 8-9, Node.js 0.10, 0.12, 4, & 5, & PhantomJS 1.9.8.<br>
|
||||
Tested in Chrome 49-50, Firefox 45-46, IE 9-11, Edge 13, Safari 8-9, Node.js 0.10-6, & PhantomJS 1.9.8.<br>
|
||||
Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available.
|
||||
|
1
node_modules/lodash/array.js
generated
vendored
1
node_modules/lodash/array.js
generated
vendored
@ -12,6 +12,7 @@ module.exports = {
|
||||
'fill': require('./fill'),
|
||||
'findIndex': require('./findIndex'),
|
||||
'findLastIndex': require('./findLastIndex'),
|
||||
'first': require('./first'),
|
||||
'flatten': require('./flatten'),
|
||||
'flattenDeep': require('./flattenDeep'),
|
||||
'flattenDepth': require('./flattenDepth'),
|
||||
|
1
node_modules/lodash/lang.js
generated
vendored
1
node_modules/lodash/lang.js
generated
vendored
@ -47,6 +47,7 @@ module.exports = {
|
||||
'lt': require('./lt'),
|
||||
'lte': require('./lte'),
|
||||
'toArray': require('./toArray'),
|
||||
'toFinite': require('./toFinite'),
|
||||
'toInteger': require('./toInteger'),
|
||||
'toLength': require('./toLength'),
|
||||
'toNumber': require('./toNumber'),
|
||||
|
37
node_modules/lodash/package.json
generated
vendored
37
node_modules/lodash/package.json
generated
vendored
@ -1,42 +1,43 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"lodash@^4.6.1",
|
||||
"lodash@^4.11.1",
|
||||
"/Users/martin/newdev/Rinser"
|
||||
]
|
||||
],
|
||||
"_from": "lodash@>=4.6.1 <5.0.0",
|
||||
"_id": "lodash@4.11.1",
|
||||
"_from": "lodash@>=4.11.1 <5.0.0",
|
||||
"_id": "lodash@4.13.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/lodash",
|
||||
"_nodeVersion": "5.5.0",
|
||||
"_nodeVersion": "4.2.4",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-16-east.internal.npmjs.com",
|
||||
"tmp": "tmp/lodash-4.11.1.tgz_1460618480099_0.40750555554404855"
|
||||
"tmp": "tmp/lodash-4.13.1.tgz_1464019142054_0.5244540225248784"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "john.david.dalton@gmail.com",
|
||||
"name": "jdalton"
|
||||
},
|
||||
"_npmVersion": "2.15.3",
|
||||
"_npmVersion": "2.14.12",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "lodash",
|
||||
"raw": "lodash@^4.6.1",
|
||||
"rawSpec": "^4.6.1",
|
||||
"raw": "lodash@^4.11.1",
|
||||
"rawSpec": "^4.11.1",
|
||||
"scope": null,
|
||||
"spec": ">=4.6.1 <5.0.0",
|
||||
"spec": ">=4.11.1 <5.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/",
|
||||
"/cheerio"
|
||||
"/cheerio",
|
||||
"/gulp-jshint"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/lodash/-/lodash-4.11.1.tgz",
|
||||
"_shasum": "a32106eb8e2ec8e82c241611414773c9df15f8bc",
|
||||
"_resolved": "http://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz",
|
||||
"_shasum": "83e4b10913f48496d4d16fec4a560af2ee744b68",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "lodash@^4.6.1",
|
||||
"_spec": "lodash@^4.11.1",
|
||||
"_where": "/Users/martin/newdev/Rinser",
|
||||
"author": {
|
||||
"email": "john.david.dalton@gmail.com",
|
||||
@ -68,8 +69,8 @@
|
||||
"devDependencies": {},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "a32106eb8e2ec8e82c241611414773c9df15f8bc",
|
||||
"tarball": "https://registry.npmjs.org/lodash/-/lodash-4.11.1.tgz"
|
||||
"shasum": "83e4b10913f48496d4d16fec4a560af2ee744b68",
|
||||
"tarball": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz"
|
||||
},
|
||||
"homepage": "https://lodash.com/",
|
||||
"icon": "https://lodash.com/icon.svg",
|
||||
@ -85,10 +86,6 @@
|
||||
"name": "jdalton",
|
||||
"email": "john.david.dalton@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "jridgewell",
|
||||
"email": "justin+npm@ridgewell.name"
|
||||
},
|
||||
{
|
||||
"name": "mathias",
|
||||
"email": "mathias@qiwi.be"
|
||||
@ -108,5 +105,5 @@
|
||||
"scripts": {
|
||||
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
|
||||
},
|
||||
"version": "4.11.1"
|
||||
"version": "4.13.1"
|
||||
}
|
||||
|
3
node_modules/rss-braider/lib/RssBraider.js
generated
vendored
3
node_modules/rss-braider/lib/RssBraider.js
generated
vendored
@ -93,7 +93,6 @@ RssBraider.prototype.processFeed = function(feed_name, format, callback)
|
||||
req.on('response', function (res) {
|
||||
var stream = this;
|
||||
if (res.statusCode !== 200) {
|
||||
console.error(source);
|
||||
return this.emit('error', 'Bad status code: ' + res.statusCode);
|
||||
}
|
||||
stream.pipe(feedparser);
|
||||
@ -295,4 +294,4 @@ RssBraider.prototype.date_sort = function(articles_arr) {
|
||||
return sorted_articles;
|
||||
};
|
||||
|
||||
module.exports = RssBraider;
|
||||
module.exports = RssBraider;
|
8
node_modules/rss-braider/package.json
generated
vendored
8
node_modules/rss-braider/package.json
generated
vendored
@ -2,7 +2,7 @@
|
||||
"_args": [
|
||||
[
|
||||
"rss-braider@^1.0.0",
|
||||
"C:\\mddev\\rinser"
|
||||
"/Users/martin/newdev/Rinser"
|
||||
]
|
||||
],
|
||||
"_from": "rss-braider@>=1.0.0 <2.0.0",
|
||||
@ -28,11 +28,11 @@
|
||||
"_requiredBy": [
|
||||
"#DEV:/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/rss-braider/-/rss-braider-1.0.0.tgz",
|
||||
"_resolved": "http://registry.npmjs.org/rss-braider/-/rss-braider-1.0.0.tgz",
|
||||
"_shasum": "1ea5ddf8d39151728a5a039af5b0c3407f3e464b",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "rss-braider@^1.0.0",
|
||||
"_where": "C:\\mddev\\rinser",
|
||||
"_where": "/Users/martin/newdev/Rinser",
|
||||
"author": {
|
||||
"email": "kgebhardt@kqed.org",
|
||||
"name": "Kip Gebhardt"
|
||||
@ -58,7 +58,7 @@
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "1ea5ddf8d39151728a5a039af5b0c3407f3e464b",
|
||||
"tarball": "http://registry.npmjs.org/rss-braider/-/rss-braider-1.0.0.tgz"
|
||||
"tarball": "https://registry.npmjs.org/rss-braider/-/rss-braider-1.0.0.tgz"
|
||||
},
|
||||
"gitHead": "755970200088eab93a8a8ae15b47a11b9fbb5880",
|
||||
"homepage": "https://github.com/KQED/rss-braider",
|
||||
|
20
paleo.js
20
paleo.js
@ -22,43 +22,43 @@ feeds.simple_test_feed = {
|
||||
},
|
||||
"plugins": ['filter_3_days', "fix_images", 'fix_scripts'],
|
||||
"sources": [{
|
||||
/* "name" : "JobServe",*/
|
||||
|
||||
"count": 100,
|
||||
"feed_url": "http://feeds.feedburner.com/PaleoPlan"
|
||||
}, {
|
||||
/* "name" : "JobServe",*/
|
||||
|
||||
"count": 100,
|
||||
"feed_url": "http://nomnompaleo.com/rss"
|
||||
}, {
|
||||
/* "name" : "JobServe",*/
|
||||
|
||||
"count": 100,
|
||||
"feed_url": "http://thepaleodiet.com/feed/"
|
||||
}, {
|
||||
/* "name" : "JobServe",*/
|
||||
|
||||
"count": 100,
|
||||
"feed_url": "http://paleoleap.com/feed/"
|
||||
}, {
|
||||
/* "name" : "JobServe",*/
|
||||
|
||||
"count": 100,
|
||||
"feed_url": "http://ultimatepaleoguide.com/feed/"
|
||||
}, {
|
||||
/* "name" : "JobServe",*/
|
||||
|
||||
"count": 100,
|
||||
"feed_url": "http://elanaspantry.com/feed/"
|
||||
}, {
|
||||
/* "name" : "JobServe",*/
|
||||
|
||||
"count": 100,
|
||||
"feed_url": "http://feeds.feedburner.com/Paleomg-PaleoRecipes"
|
||||
}, {
|
||||
/* "name" : "JobServe",*/
|
||||
|
||||
"count": 100,
|
||||
"feed_url": "http://civilizedcavemancooking.com/feed/"
|
||||
}, {
|
||||
/* "name" : "JobServe",*/
|
||||
|
||||
"count": 100,
|
||||
"feed_url": "http://www.ruled.me/feed/"
|
||||
}, {
|
||||
/* "name" : "JobServe",*/
|
||||
|
||||
"count": 100,
|
||||
"feed_url": "http://www.primalbro.com/blog?format=RSS"
|
||||
}
|
||||
|
@ -1,9 +1,7 @@
|
||||
module.exports = function (item, itemOptions, source) {
|
||||
//console.log(itemOptions);
|
||||
// console.log((typeof itemOptions.descriptions !== 'undefined') && (itemOptions.description !== null));
|
||||
//if ((typeof itemOptions.descriptions !== 'undefined') && (itemOptions.description !== null)) {
|
||||
if ((typeof itemOptions.descriptions !== 'undefined') && (itemOptions.description !== null)) {
|
||||
var match = itemOptions.description.replace(/\ssrc=/gi, ' src="assets/fm.png" data-src=');
|
||||
itemOptions.description = match;
|
||||
//}
|
||||
}
|
||||
return itemOptions;
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
module.exports = function (item, itemOptions, source) {
|
||||
//if ((typeof itemOptions.descriptions !== 'undefined') && (itemOptions.description !== null)) {
|
||||
if ((typeof itemOptions.descriptions !== 'undefined') && (itemOptions.description !== null)) {
|
||||
|
||||
var match = itemOptions.description.replace(
|
||||
/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
|
||||
@ -7,7 +7,7 @@ module.exports = function (item, itemOptions, source) {
|
||||
match = match.replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,
|
||||
'');
|
||||
itemOptions.description = match;
|
||||
//}
|
||||
}
|
||||
return itemOptions;
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user