News fix
This commit is contained in:
parent
9acbba6843
commit
6bf6ea263c
@ -3,14 +3,4 @@
|
|||||||
<component name="JavaScriptSettings">
|
<component name="JavaScriptSettings">
|
||||||
<option name="languageLevel" value="JSX" />
|
<option name="languageLevel" value="JSX" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
|
||||||
<OptionsSetting value="true" id="Add" />
|
|
||||||
<OptionsSetting value="true" id="Remove" />
|
|
||||||
<OptionsSetting value="true" id="Checkout" />
|
|
||||||
<OptionsSetting value="true" id="Update" />
|
|
||||||
<OptionsSetting value="true" id="Status" />
|
|
||||||
<OptionsSetting value="true" id="Edit" />
|
|
||||||
<ConfirmationsSetting value="0" id="Add" />
|
|
||||||
<ConfirmationsSetting value="0" id="Remove" />
|
|
||||||
</component>
|
|
||||||
</project>
|
</project>
|
File diff suppressed because it is too large
Load Diff
17
lifestyle.js
17
lifestyle.js
@ -18,7 +18,7 @@ feeds.simple_test_feed = {
|
|||||||
"count": 100,
|
"count": 100,
|
||||||
"feed_url": "http://feeds2.feedburner.com/acquire"
|
"feed_url": "http://feeds2.feedburner.com/acquire"
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
"count": 100,
|
"count": 100,
|
||||||
@ -57,11 +57,11 @@ feeds.simple_test_feed = {
|
|||||||
"feed_url": "http://feeds.feedburner.com/gearpatrol"
|
"feed_url": "http://feeds.feedburner.com/gearpatrol"
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
/*{
|
||||||
|
|
||||||
"count": 100,
|
"count": 100,
|
||||||
"feed_url": "http://www.getkempt.com/rss.xml"
|
"feed_url": "http://www.getkempt.com/rss.xml"
|
||||||
},
|
},*/
|
||||||
{
|
{
|
||||||
|
|
||||||
"count": 100,
|
"count": 100,
|
||||||
@ -187,10 +187,10 @@ feeds.simple_test_feed = {
|
|||||||
"count": 100,
|
"count": 100,
|
||||||
"feed_url": "https://feeds.feedburner.com/thisfits"
|
"feed_url": "https://feeds.feedburner.com/thisfits"
|
||||||
},
|
},
|
||||||
{
|
/*{
|
||||||
"count": 100,
|
"count": 100,
|
||||||
"feed_url": "http://www.businessoffashion.com/syndication/feed"
|
"feed_url": "http://www.businessoffashion.com/syndication/feed"
|
||||||
},
|
},*/
|
||||||
{
|
{
|
||||||
"count": 100,
|
"count": 100,
|
||||||
"feed_url": "http://dieworkwear.com/rss"
|
"feed_url": "http://dieworkwear.com/rss"
|
||||||
@ -240,7 +240,12 @@ feeds.simple_test_feed = {
|
|||||||
{
|
{
|
||||||
"count": 100,
|
"count": 100,
|
||||||
"feed_url": "https://feeds.feedburner.com/ManOfMany"
|
"feed_url": "https://feeds.feedburner.com/ManOfMany"
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"count": 100,
|
||||||
|
"feed_url": "http://feeds.feedburner.com/nymag/vulture"
|
||||||
|
}
|
||||||
|
|
||||||
/*,
|
/*,
|
||||||
{
|
{
|
||||||
"count": 100,
|
"count": 100,
|
||||||
|
34
news.json
Normal file
34
news.json
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"feed_name": "feed",
|
||||||
|
"default_count": 1,
|
||||||
|
"no_cdata_fields": [
|
||||||
|
"description"
|
||||||
|
],
|
||||||
|
"meta": {
|
||||||
|
"title": "News",
|
||||||
|
"description": "Combined News Feed",
|
||||||
|
"site_url": "http://pipes.silvrtree.co.uk/news.xml"
|
||||||
|
},
|
||||||
|
"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,
|
||||||
|
"feed_url": "http://feeds.bbci.co.uk/news/rss.xml?edition=uk"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
2
node_modules/lodash/LICENSE
generated
vendored
2
node_modules/lodash/LICENSE
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
Copyright JS Foundation and other contributors <https://js.foundation/>
|
||||||
|
|
||||||
Based on Underscore.js, copyright Jeremy Ashkenas,
|
Based on Underscore.js, copyright Jeremy Ashkenas,
|
||||||
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||||
|
23
node_modules/lodash/README.md
generated
vendored
23
node_modules/lodash/README.md
generated
vendored
@ -1,12 +1,12 @@
|
|||||||
# lodash v4.13.1
|
# lodash v4.16.6
|
||||||
|
|
||||||
The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules.
|
The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Using npm:
|
Using npm:
|
||||||
```bash
|
```shell
|
||||||
$ {sudo -H} npm i -g npm
|
$ npm i -g npm
|
||||||
$ npm i --save lodash
|
$ npm i --save lodash
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -16,25 +16,24 @@ In Node.js:
|
|||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
// Load the core build.
|
// Load the core build.
|
||||||
var _ = require('lodash/core');
|
var _ = require('lodash/core');
|
||||||
// Load the fp build for immutable auto-curried iteratee-first data-last methods.
|
// Load the FP build for immutable auto-curried iteratee-first data-last methods.
|
||||||
var fp = require('lodash/fp');
|
var fp = require('lodash/fp');
|
||||||
|
|
||||||
// Load a method category.
|
// Load method categories.
|
||||||
var array = require('lodash/array');
|
var array = require('lodash/array');
|
||||||
var object = require('lodash/fp/object');
|
var object = require('lodash/fp/object');
|
||||||
|
|
||||||
// Load a single method for smaller builds with browserify/rollup/webpack.
|
// Cherry-pick methods for smaller browserify/rollup/webpack bundles.
|
||||||
var chunk = require('lodash/chunk');
|
var at = require('lodash/at');
|
||||||
var extend = require('lodash/fp/extend');
|
var curryN = require('lodash/fp/curryN');
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [package source](https://github.com/lodash/lodash/tree/4.13.1-npm) for more details.
|
See the [package source](https://github.com/lodash/lodash/tree/4.16.6-npm) for more details.
|
||||||
|
|
||||||
**Note:**<br>
|
**Note:**<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 Lodash use in the Node.js < 6 REPL.
|
||||||
Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes `lodash` by default.
|
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
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>
|
Tested in Chrome 53-54, Firefox 48-49, IE 11, Edge 14, Safari 9-10, Node.js 6-7, & PhantomJS 2.1.1.<br>
|
||||||
Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available.
|
Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available.
|
||||||
|
1
node_modules/lodash/collection.js
generated
vendored
1
node_modules/lodash/collection.js
generated
vendored
@ -1,5 +1,4 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
'at': require('./at'),
|
|
||||||
'countBy': require('./countBy'),
|
'countBy': require('./countBy'),
|
||||||
'each': require('./each'),
|
'each': require('./each'),
|
||||||
'eachRight': require('./eachRight'),
|
'eachRight': require('./eachRight'),
|
||||||
|
1
node_modules/lodash/lang.js
generated
vendored
1
node_modules/lodash/lang.js
generated
vendored
@ -4,6 +4,7 @@ module.exports = {
|
|||||||
'cloneDeep': require('./cloneDeep'),
|
'cloneDeep': require('./cloneDeep'),
|
||||||
'cloneDeepWith': require('./cloneDeepWith'),
|
'cloneDeepWith': require('./cloneDeepWith'),
|
||||||
'cloneWith': require('./cloneWith'),
|
'cloneWith': require('./cloneWith'),
|
||||||
|
'conformsTo': require('./conformsTo'),
|
||||||
'eq': require('./eq'),
|
'eq': require('./eq'),
|
||||||
'gt': require('./gt'),
|
'gt': require('./gt'),
|
||||||
'gte': require('./gte'),
|
'gte': require('./gte'),
|
||||||
|
1
node_modules/lodash/object.js
generated
vendored
1
node_modules/lodash/object.js
generated
vendored
@ -3,6 +3,7 @@ module.exports = {
|
|||||||
'assignIn': require('./assignIn'),
|
'assignIn': require('./assignIn'),
|
||||||
'assignInWith': require('./assignInWith'),
|
'assignInWith': require('./assignInWith'),
|
||||||
'assignWith': require('./assignWith'),
|
'assignWith': require('./assignWith'),
|
||||||
|
'at': require('./at'),
|
||||||
'create': require('./create'),
|
'create': require('./create'),
|
||||||
'defaults': require('./defaults'),
|
'defaults': require('./defaults'),
|
||||||
'defaultsDeep': require('./defaultsDeep'),
|
'defaultsDeep': require('./defaultsDeep'),
|
||||||
|
53
node_modules/lodash/package.json
generated
vendored
53
node_modules/lodash/package.json
generated
vendored
@ -1,47 +1,56 @@
|
|||||||
{
|
{
|
||||||
"_args": [
|
"_args": [
|
||||||
[
|
[
|
||||||
"lodash@^4.11.1",
|
{
|
||||||
"/Users/martin/newdev/Rinser"
|
"raw": "lodash@^4.11.1",
|
||||||
|
"scope": null,
|
||||||
|
"escapedName": "lodash",
|
||||||
|
"name": "lodash",
|
||||||
|
"rawSpec": "^4.11.1",
|
||||||
|
"spec": ">=4.11.1 <5.0.0",
|
||||||
|
"type": "range"
|
||||||
|
},
|
||||||
|
"/home/martin/mddev/Rinser"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"_from": "lodash@>=4.11.1 <5.0.0",
|
"_from": "lodash@>=4.11.1 <5.0.0",
|
||||||
"_id": "lodash@4.13.1",
|
"_id": "lodash@4.16.6",
|
||||||
"_inCache": true,
|
"_inCache": true,
|
||||||
"_installable": true,
|
|
||||||
"_location": "/lodash",
|
"_location": "/lodash",
|
||||||
"_nodeVersion": "4.2.4",
|
"_nodeVersion": "7.0.0",
|
||||||
"_npmOperationalInternal": {
|
"_npmOperationalInternal": {
|
||||||
"host": "packages-16-east.internal.npmjs.com",
|
"host": "packages-18-east.internal.npmjs.com",
|
||||||
"tmp": "tmp/lodash-4.13.1.tgz_1464019142054_0.5244540225248784"
|
"tmp": "tmp/lodash-4.16.6.tgz_1477982285913_0.34612850472331047"
|
||||||
},
|
},
|
||||||
"_npmUser": {
|
"_npmUser": {
|
||||||
"email": "john.david.dalton@gmail.com",
|
"name": "jdalton",
|
||||||
"name": "jdalton"
|
"email": "john.david.dalton@gmail.com"
|
||||||
},
|
},
|
||||||
"_npmVersion": "2.14.12",
|
"_npmVersion": "2.15.11",
|
||||||
"_phantomChildren": {},
|
"_phantomChildren": {},
|
||||||
"_requested": {
|
"_requested": {
|
||||||
"name": "lodash",
|
|
||||||
"raw": "lodash@^4.11.1",
|
"raw": "lodash@^4.11.1",
|
||||||
"rawSpec": "^4.11.1",
|
|
||||||
"scope": null,
|
"scope": null,
|
||||||
|
"escapedName": "lodash",
|
||||||
|
"name": "lodash",
|
||||||
|
"rawSpec": "^4.11.1",
|
||||||
"spec": ">=4.11.1 <5.0.0",
|
"spec": ">=4.11.1 <5.0.0",
|
||||||
"type": "range"
|
"type": "range"
|
||||||
},
|
},
|
||||||
"_requiredBy": [
|
"_requiredBy": [
|
||||||
"#DEV:/",
|
"#USER",
|
||||||
|
"/",
|
||||||
"/cheerio",
|
"/cheerio",
|
||||||
"/gulp-jshint"
|
"/gulp-jshint"
|
||||||
],
|
],
|
||||||
"_resolved": "http://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz",
|
"_resolved": "http://localhost:4873/lodash/-/lodash-4.16.6.tgz",
|
||||||
"_shasum": "83e4b10913f48496d4d16fec4a560af2ee744b68",
|
"_shasum": "d22c9ac660288f3843e16ba7d2b5d06cca27d777",
|
||||||
"_shrinkwrap": null,
|
"_shrinkwrap": null,
|
||||||
"_spec": "lodash@^4.11.1",
|
"_spec": "lodash@^4.11.1",
|
||||||
"_where": "/Users/martin/newdev/Rinser",
|
"_where": "/home/martin/mddev/Rinser",
|
||||||
"author": {
|
"author": {
|
||||||
"email": "john.david.dalton@gmail.com",
|
|
||||||
"name": "John-David Dalton",
|
"name": "John-David Dalton",
|
||||||
|
"email": "john.david.dalton@gmail.com",
|
||||||
"url": "http://allyoucanleet.com/"
|
"url": "http://allyoucanleet.com/"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
@ -69,8 +78,8 @@
|
|||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"directories": {},
|
"directories": {},
|
||||||
"dist": {
|
"dist": {
|
||||||
"shasum": "83e4b10913f48496d4d16fec4a560af2ee744b68",
|
"shasum": "d22c9ac660288f3843e16ba7d2b5d06cca27d777",
|
||||||
"tarball": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz"
|
"tarball": "http://localhost:4873/lodash/-/lodash-4.16.6.tgz"
|
||||||
},
|
},
|
||||||
"homepage": "https://lodash.com/",
|
"homepage": "https://lodash.com/",
|
||||||
"icon": "https://lodash.com/icon.svg",
|
"icon": "https://lodash.com/icon.svg",
|
||||||
@ -89,10 +98,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mathias",
|
"name": "mathias",
|
||||||
"email": "mathias@qiwi.be"
|
"email": "mathias@qiwi.be"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "phated",
|
|
||||||
"email": "blaine.bublitz@gmail.com"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"name": "lodash",
|
"name": "lodash",
|
||||||
@ -105,5 +110,5 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
|
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
|
||||||
},
|
},
|
||||||
"version": "4.13.1"
|
"version": "4.16.6"
|
||||||
}
|
}
|
||||||
|
@ -24,15 +24,18 @@
|
|||||||
"rss-braider": "git+http://gitlab.silvrtree.co.uk/martind2000/rss-braider.git"
|
"rss-braider": "git+http://gitlab.silvrtree.co.uk/martind2000/rss-braider.git"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"express": "^4.13.4",
|
|
||||||
"body-parser": "^1.14.2",
|
"body-parser": "^1.14.2",
|
||||||
"cookie-parser": "*",
|
"cookie-parser": "*",
|
||||||
"ejs": "*",
|
"ejs": "*",
|
||||||
"errorhandler": "*",
|
"errorhandler": "*",
|
||||||
"morgan": "*",
|
"express": "^4.13.4",
|
||||||
"express-session": "*",
|
"express-session": "*",
|
||||||
"htmlparser": "^1.7.7",
|
"htmlparser": "^1.7.7",
|
||||||
|
"jsonfile": "^2.4.0",
|
||||||
|
"lodash": "^4.16.6",
|
||||||
"method-override": "*",
|
"method-override": "*",
|
||||||
"request": "*"
|
"morgan": "*",
|
||||||
|
"request": "*",
|
||||||
|
"yargs": "^6.3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
84
reader.js
Normal file
84
reader.js
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
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 jsonfile = require('jsonfile');
|
||||||
|
var argv = require('yargs').argv;
|
||||||
|
|
||||||
|
|
||||||
|
var log4js = require('log4js');
|
||||||
|
var logger = log4js.getLogger();
|
||||||
|
|
||||||
|
var feedFileName = argv.feeds + '.json';
|
||||||
|
|
||||||
|
logger.debug(feedFileName);
|
||||||
|
|
||||||
|
feeds.simple_test_feed = {} ;
|
||||||
|
|
||||||
|
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');
|
||||||
|
|
||||||
|
jsonfile.readFile(feedFileName, function (err, obj) {
|
||||||
|
|
||||||
|
if (err) {
|
||||||
|
logger.error(err);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
feeds.simple_test_feed = obj;
|
||||||
|
|
||||||
|
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!");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user