diff --git a/.idea/misc.xml b/.idea/misc.xml index e503d88..24eb271 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,14 +3,4 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3baba2f..522f851 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,148 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -26,41 +165,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -69,18 +178,48 @@ - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -90,7 +229,17 @@ - + + + + + + + + + + + @@ -99,8 +248,8 @@ - - + + @@ -110,17 +259,7 @@ - - - - - - - - - - - + @@ -143,8 +282,6 @@ @@ -204,35 +343,6 @@ $PROJECT_DIR$/gulpfile.js - - - scripts - - - vendor - - - remote - - - styles - - - partials - - - index - - - clean - - - - - - default - - DEFINITION_ORDER @@ -241,20 +351,12 @@ - - - - - - - - - - + + @@ -270,15 +372,8 @@ - - - - - - - - - - - - - - + @@ -326,9 +408,8 @@ - - - + + @@ -354,17 +435,29 @@ - - - - + - + + + + + + + @@ -387,6 +480,43 @@ + + + + + + @@ -399,6 +529,12 @@ + + - + @@ -515,13 +651,11 @@ - - - 1458042886976 - 1458043875334 @@ -859,37 +993,45 @@ - - - - + - - + + + - + + + + - - @@ -913,6 +1055,9 @@ + + @@ -959,315 +1105,225 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - + - - - - - - - + - + - + - - - - - - - - + - + - - - - - - - - + + - + - + - + - + - + - + - - - - - - - - + - - - - - - - - + + - + - + - + - + - + - - - - - - - - + + - + - + - + - + - + - + - + - - - - - - - - - - - + + + - - + + - - + + @@ -1275,15 +1331,40 @@ - + - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1291,31 +1372,31 @@ - + - + - - + + - + - - + + - + - - + + diff --git a/lifestyle.js b/lifestyle.js index 436ec28..fc92a18 100644 --- a/lifestyle.js +++ b/lifestyle.js @@ -18,7 +18,7 @@ feeds.simple_test_feed = { "count": 100, "feed_url": "http://feeds2.feedburner.com/acquire" }, - + { "count": 100, @@ -57,11 +57,11 @@ feeds.simple_test_feed = { "feed_url": "http://feeds.feedburner.com/gearpatrol" }, - { + /*{ "count": 100, "feed_url": "http://www.getkempt.com/rss.xml" - }, + },*/ { "count": 100, @@ -187,10 +187,10 @@ feeds.simple_test_feed = { "count": 100, "feed_url": "https://feeds.feedburner.com/thisfits" }, - { + /*{ "count": 100, "feed_url": "http://www.businessoffashion.com/syndication/feed" - }, + },*/ { "count": 100, "feed_url": "http://dieworkwear.com/rss" @@ -240,7 +240,12 @@ feeds.simple_test_feed = { { "count": 100, "feed_url": "https://feeds.feedburner.com/ManOfMany" - } + }, + { + "count": 100, + "feed_url": "http://feeds.feedburner.com/nymag/vulture" + } + /*, { "count": 100, diff --git a/news.json b/news.json new file mode 100644 index 0000000..2336252 --- /dev/null +++ b/news.json @@ -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" + } + ] +} diff --git a/node_modules/lodash/LICENSE b/node_modules/lodash/LICENSE index e0c69d5..c6f2f61 100644 --- a/node_modules/lodash/LICENSE +++ b/node_modules/lodash/LICENSE @@ -1,4 +1,4 @@ -Copyright jQuery Foundation and other contributors +Copyright JS Foundation and other contributors Based on Underscore.js, copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors diff --git a/node_modules/lodash/README.md b/node_modules/lodash/README.md index 59cc860..f874f13 100644 --- a/node_modules/lodash/README.md +++ b/node_modules/lodash/README.md @@ -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. ## Installation Using npm: -```bash -$ {sudo -H} npm i -g npm +```shell +$ npm i -g npm $ npm i --save lodash ``` @@ -16,25 +16,24 @@ In Node.js: var _ = require('lodash'); // Load the core build. 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'); -// Load a method category. +// Load method categories. var array = require('lodash/array'); var object = require('lodash/fp/object'); -// Load a single method for smaller builds with browserify/rollup/webpack. -var chunk = require('lodash/chunk'); -var extend = require('lodash/fp/extend'); +// Cherry-pick methods for smaller browserify/rollup/webpack bundles. +var at = require('lodash/at'); +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:**
-Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` in the Node.js < 6 REPL.
-Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes `lodash` by default. +Install [n_](https://www.npmjs.com/package/n_) for Lodash use in the Node.js < 6 REPL. ## 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.
+Tested in Chrome 53-54, Firefox 48-49, IE 11, Edge 14, Safari 9-10, Node.js 6-7, & PhantomJS 2.1.1.
Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. diff --git a/node_modules/lodash/collection.js b/node_modules/lodash/collection.js index 22b0c8b..77fe837 100644 --- a/node_modules/lodash/collection.js +++ b/node_modules/lodash/collection.js @@ -1,5 +1,4 @@ module.exports = { - 'at': require('./at'), 'countBy': require('./countBy'), 'each': require('./each'), 'eachRight': require('./eachRight'), diff --git a/node_modules/lodash/lang.js b/node_modules/lodash/lang.js index 6340c4b..a396216 100644 --- a/node_modules/lodash/lang.js +++ b/node_modules/lodash/lang.js @@ -4,6 +4,7 @@ module.exports = { 'cloneDeep': require('./cloneDeep'), 'cloneDeepWith': require('./cloneDeepWith'), 'cloneWith': require('./cloneWith'), + 'conformsTo': require('./conformsTo'), 'eq': require('./eq'), 'gt': require('./gt'), 'gte': require('./gte'), diff --git a/node_modules/lodash/object.js b/node_modules/lodash/object.js index d6f51c8..f046b05 100644 --- a/node_modules/lodash/object.js +++ b/node_modules/lodash/object.js @@ -3,6 +3,7 @@ module.exports = { 'assignIn': require('./assignIn'), 'assignInWith': require('./assignInWith'), 'assignWith': require('./assignWith'), + 'at': require('./at'), 'create': require('./create'), 'defaults': require('./defaults'), 'defaultsDeep': require('./defaultsDeep'), diff --git a/node_modules/lodash/package.json b/node_modules/lodash/package.json index c41cbbd..e129724 100644 --- a/node_modules/lodash/package.json +++ b/node_modules/lodash/package.json @@ -1,47 +1,56 @@ { "_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", - "_id": "lodash@4.13.1", + "_id": "lodash@4.16.6", "_inCache": true, - "_installable": true, "_location": "/lodash", - "_nodeVersion": "4.2.4", + "_nodeVersion": "7.0.0", "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash-4.13.1.tgz_1464019142054_0.5244540225248784" + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/lodash-4.16.6.tgz_1477982285913_0.34612850472331047" }, "_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": {}, "_requested": { - "name": "lodash", "raw": "lodash@^4.11.1", - "rawSpec": "^4.11.1", "scope": null, + "escapedName": "lodash", + "name": "lodash", + "rawSpec": "^4.11.1", "spec": ">=4.11.1 <5.0.0", "type": "range" }, "_requiredBy": [ - "#DEV:/", + "#USER", + "/", "/cheerio", "/gulp-jshint" ], - "_resolved": "http://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz", - "_shasum": "83e4b10913f48496d4d16fec4a560af2ee744b68", + "_resolved": "http://localhost:4873/lodash/-/lodash-4.16.6.tgz", + "_shasum": "d22c9ac660288f3843e16ba7d2b5d06cca27d777", "_shrinkwrap": null, "_spec": "lodash@^4.11.1", - "_where": "/Users/martin/newdev/Rinser", + "_where": "/home/martin/mddev/Rinser", "author": { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, "bugs": { @@ -69,8 +78,8 @@ "devDependencies": {}, "directories": {}, "dist": { - "shasum": "83e4b10913f48496d4d16fec4a560af2ee744b68", - "tarball": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz" + "shasum": "d22c9ac660288f3843e16ba7d2b5d06cca27d777", + "tarball": "http://localhost:4873/lodash/-/lodash-4.16.6.tgz" }, "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -89,10 +98,6 @@ { "name": "mathias", "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine.bublitz@gmail.com" } ], "name": "lodash", @@ -105,5 +110,5 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "version": "4.13.1" + "version": "4.16.6" } diff --git a/package.json b/package.json index 6be4a04..57b5141 100644 --- a/package.json +++ b/package.json @@ -24,15 +24,18 @@ "rss-braider": "git+http://gitlab.silvrtree.co.uk/martind2000/rss-braider.git" }, "dependencies": { - "express": "^4.13.4", "body-parser": "^1.14.2", "cookie-parser": "*", "ejs": "*", "errorhandler": "*", - "morgan": "*", + "express": "^4.13.4", "express-session": "*", "htmlparser": "^1.7.7", + "jsonfile": "^2.4.0", + "lodash": "^4.16.6", "method-override": "*", - "request": "*" + "morgan": "*", + "request": "*", + "yargs": "^6.3.0" } } diff --git a/reader.js b/reader.js new file mode 100644 index 0000000..802d3e5 --- /dev/null +++ b/reader.js @@ -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!"); + }); + }); + + +}); + + + +