News fix
This commit is contained in:
parent
9acbba6843
commit
6bf6ea263c
@ -3,14 +3,4 @@
|
||||
<component name="JavaScriptSettings">
|
||||
<option name="languageLevel" value="JSX" />
|
||||
</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>
|
File diff suppressed because it is too large
Load Diff
13
lifestyle.js
13
lifestyle.js
@ -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,
|
||||
|
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,
|
||||
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.
|
||||
|
||||
## 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:**<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.
|
||||
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.<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.
|
||||
|
1
node_modules/lodash/collection.js
generated
vendored
1
node_modules/lodash/collection.js
generated
vendored
@ -1,5 +1,4 @@
|
||||
module.exports = {
|
||||
'at': require('./at'),
|
||||
'countBy': require('./countBy'),
|
||||
'each': require('./each'),
|
||||
'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'),
|
||||
'cloneDeepWith': require('./cloneDeepWith'),
|
||||
'cloneWith': require('./cloneWith'),
|
||||
'conformsTo': require('./conformsTo'),
|
||||
'eq': require('./eq'),
|
||||
'gt': require('./gt'),
|
||||
'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'),
|
||||
'assignInWith': require('./assignInWith'),
|
||||
'assignWith': require('./assignWith'),
|
||||
'at': require('./at'),
|
||||
'create': require('./create'),
|
||||
'defaults': require('./defaults'),
|
||||
'defaultsDeep': require('./defaultsDeep'),
|
||||
|
53
node_modules/lodash/package.json
generated
vendored
53
node_modules/lodash/package.json
generated
vendored
@ -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"
|
||||
}
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
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