reallysimple 0.4.9 → 0.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -10
- package/reallysimple.js +14 -4
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "reallysimple",
|
|
1
|
+
{
|
|
2
|
+
"name": "reallysimple",
|
|
3
3
|
"description": "A Node package that reads RSS-like feeds and calls back with a simple, consistent JavaScript object. Easy to use, hides the history.",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.12",
|
|
5
5
|
"author": "Dave Winer <dave@scripting.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"files": [
|
|
8
8
|
"reallysimple.js"
|
|
9
|
-
|
|
9
|
+
],
|
|
10
10
|
"main": "reallysimple.js",
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
13
|
"url": "https://github.com/scripting/reallysimple.git"
|
|
14
|
-
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"
|
|
14
|
+
},
|
|
15
|
+
"dependencies" : {
|
|
16
|
+
"opml": "*",
|
|
17
17
|
"daveutils": "*",
|
|
18
|
-
"
|
|
19
|
-
|
|
18
|
+
"davefeedread": "*"
|
|
19
|
+
},
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": "*"
|
|
22
|
+
}
|
|
22
23
|
}
|
|
23
|
-
}
|
package/reallysimple.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
var myProductName = "reallysimple"
|
|
1
|
+
var myProductName = "reallysimple", myVersion = "0.4.12";
|
|
2
2
|
|
|
3
3
|
exports.readFeed = readFeed;
|
|
4
4
|
exports.convertFeedToOpml = convertFeedToOpml;
|
|
5
|
+
exports.setConfig = setConfig; //6/23/22 by DW
|
|
5
6
|
|
|
6
7
|
const utils = require ("daveutils");
|
|
7
8
|
const request = require ("request");
|
|
@@ -20,9 +21,14 @@ const allowedEnclosureNames = [
|
|
|
20
21
|
];
|
|
21
22
|
|
|
22
23
|
var config = {
|
|
23
|
-
timeOutSecs:
|
|
24
|
+
timeOutSecs: 10
|
|
24
25
|
}
|
|
25
26
|
|
|
27
|
+
function setConfig (options) { //6/23/22 by DW
|
|
28
|
+
for (var x in options) {
|
|
29
|
+
config [x] = options [x];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
26
32
|
function isEmptyObject (obj) {
|
|
27
33
|
try {
|
|
28
34
|
return (Object.keys (obj).length === 0);
|
|
@@ -79,8 +85,7 @@ function convertFeedToOpml (theFeed) { //use this if you want to show an RSS fee
|
|
|
79
85
|
});
|
|
80
86
|
return (opml.stringify (theOutline));
|
|
81
87
|
}
|
|
82
|
-
function convertFeed (oldFeed) {
|
|
83
|
-
|
|
88
|
+
function convertFeed (oldFeed, whenstart) {
|
|
84
89
|
var newFeed = new Object ();
|
|
85
90
|
|
|
86
91
|
function convertOutline (jstruct) {
|
|
@@ -169,6 +174,11 @@ function convertFeed (oldFeed) {
|
|
|
169
174
|
}
|
|
170
175
|
}
|
|
171
176
|
|
|
177
|
+
newFeed.metadata = { //7/2/22 by DW
|
|
178
|
+
readerApp: myProductName + " v" + myVersion,
|
|
179
|
+
ctSecs: utils.secondsSince (whenstart)
|
|
180
|
+
};
|
|
181
|
+
|
|
172
182
|
newFeed.items = new Array ();
|
|
173
183
|
oldFeed.items.forEach (function (item) {
|
|
174
184
|
var newItem = new Object ();
|