reallysimple 0.4.7 → 0.4.8
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 +2 -2
- package/readme.md +10 -48
- package/readme.opml +11 -35
- package/reallysimple.js +24 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reallysimple",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "0.4.
|
|
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.8",
|
|
5
5
|
"author": "Dave Winer <dave@scripting.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"files": [
|
package/readme.md
CHANGED
|
@@ -1,66 +1,28 @@
|
|
|
1
1
|
# reallysimple
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A Node package that reads RSS-like feeds and calls back with a simple, consistent JavaScript object. Easy to use, hides the history.
|
|
4
4
|
|
|
5
|
-
####
|
|
6
|
-
|
|
7
|
-
RSS, Atom, and RDF.
|
|
8
|
-
|
|
9
|
-
#### Why?
|
|
10
|
-
|
|
11
|
-
I wanted to make reading a feed from a JavaScript app as easy as possible.
|
|
12
|
-
|
|
13
|
-
To hide all the history to get it out of your way.
|
|
5
|
+
#### Code example
|
|
14
6
|
|
|
15
|
-
|
|
7
|
+
I always like to see the code first...
|
|
16
8
|
|
|
17
|
-
|
|
9
|
+
```javascript
|
|
18
10
|
|
|
19
|
-
|
|
11
|
+
Here's <a href="https://github.com/scripting/reallysimple/blob/main/example/test.json">the file</a> that's created when you run the code.
|
|
20
12
|
|
|
21
|
-
####
|
|
13
|
+
#### Why?
|
|
22
14
|
|
|
23
|
-
|
|
15
|
+
I needed a simple routine to call when I wanted to read a feed.
|
|
24
16
|
|
|
25
|
-
|
|
17
|
+
#### What formats are supported?
|
|
26
18
|
|
|
27
|
-
|
|
19
|
+
RSS, Atom, and RDF.
|
|
28
20
|
|
|
29
21
|
#### What we build on
|
|
30
22
|
|
|
31
23
|
Thanks to Dan MacTough for the <a href="https://www.npmjs.com/package/feedparser">feedparser</a> package.
|
|
32
24
|
|
|
33
|
-
It also builds on the davefeedread package, which simplifies the programming interface to feedparser.
|
|
34
|
-
|
|
35
|
-
This package further simplifies the struct returned by <a href="https://www.npmjs.com/package/davefeedread">davefeedread</a>.
|
|
36
|
-
|
|
37
|
-
#### Work notes
|
|
38
|
-
|
|
39
|
-
4/7/22; 11:37:16 AM by DW
|
|
40
|
-
|
|
41
|
-
Clean up the readme file. Simplify the example app. Review docs. Start to invite collaborators to the repo, still private.
|
|
42
|
-
|
|
43
|
-
3/21/22; 10:19:22 AM by DW
|
|
44
|
-
|
|
45
|
-
Reviewing the way we represent links in items in the API.
|
|
46
|
-
|
|
47
|
-
The question is this -- how can we get a link to the item from the item.
|
|
48
|
-
|
|
49
|
-
The answer, on reflection -- rely on the link element as the permalink.
|
|
50
|
-
|
|
51
|
-
3/7/22; 10:27:47 AM by DW
|
|
52
|
-
|
|
53
|
-
Start the reallysimple repo. Publish the NPM package.
|
|
54
|
-
|
|
55
|
-
3/6/22; 11:27:52 AM by DW
|
|
56
|
-
|
|
57
|
-
It now understands various elements from the source namespace, including source:account, source:localtime and source:outline.
|
|
58
|
-
|
|
59
|
-
Started a new private GitHub repo for the project and saved the files.
|
|
60
|
-
|
|
61
|
-
Added it to my NPM sub-menu, this is going to be a supported project.
|
|
62
|
-
|
|
63
25
|
#### Comments, questions?
|
|
64
26
|
|
|
65
|
-
|
|
27
|
+
Post comments and questions in the <a href="https://github.com/scripting/reallysimple/issues/new">issues section</a> of this repo.
|
|
66
28
|
|
package/readme.opml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<opml version="2.0">
|
|
3
3
|
<head>
|
|
4
4
|
<title>readme.md</title>
|
|
5
|
-
<dateModified>
|
|
5
|
+
<dateModified>Sat, 11 Jun 2022 20:01:27 GMT</dateModified>
|
|
6
6
|
<expansionState></expansionState>
|
|
7
7
|
<vertScrollState>1</vertScrollState>
|
|
8
8
|
<windowTop>300</windowTop>
|
|
@@ -12,48 +12,24 @@
|
|
|
12
12
|
</head>
|
|
13
13
|
<body created="Sat, 05 Mar 2022 16:54:13 GMT" text="readme.md">
|
|
14
14
|
<outline created="Sat, 05 Mar 2022 16:54:15 GMT" text="# reallysimple">
|
|
15
|
-
<outline created="
|
|
15
|
+
<outline created="Sat, 11 Jun 2022 15:59:23 GMT" text="A Node package that reads RSS-like feeds and calls back with a simple, consistent JavaScript object. Easy to use, hides the history."></outline>
|
|
16
16
|
</outline>
|
|
17
|
-
<outline created="
|
|
18
|
-
<outline created="
|
|
17
|
+
<outline created="Sat, 11 Jun 2022 16:24:18 GMT" text="#### Code example">
|
|
18
|
+
<outline created="Sat, 11 Jun 2022 16:20:10 GMT" text="I always like to see the code first..."></outline>
|
|
19
|
+
<outline text="<%includeExample ("example1")%>"></outline>
|
|
20
|
+
<outline created="Mon, 07 Mar 2022 15:10:30 GMT" text="Here's <a href="https://github.com/scripting/reallysimple/blob/main/example/test.json">the file</a> that's created when you run the code. "></outline>
|
|
19
21
|
</outline>
|
|
20
|
-
<outline text="#### Why?">
|
|
21
|
-
<outline created="
|
|
22
|
-
<outline created="Thu, 17 Mar 2022 15:40:29 GMT" text="To hide all the history to get it out of your way. "></outline>
|
|
23
|
-
<outline created="Mon, 07 Mar 2022 15:16:54 GMT" text="If developers can quickly put together an app that uses feeds, people will try out more ideas, add feed support to more apps."></outline>
|
|
24
|
-
<outline created="Mon, 07 Mar 2022 15:17:44 GMT" text="I needed to simplify feed reading for the scripting system in Drummer. For scripting, simplicity is everything. Why not share the simplicity with lower level code."></outline>
|
|
25
|
-
<outline created="Mon, 07 Mar 2022 15:18:12 GMT" text="There probably is a small tradeoff in performance, you can probably write faster code by going straight to the feedparser level. And that's fine for applications that require the maximum performance, perhaps where you're reading a thousand feeds per sectond. "></outline>
|
|
22
|
+
<outline created="Sat, 11 Jun 2022 16:00:30 GMT" text="#### Why?">
|
|
23
|
+
<outline created="Sat, 11 Jun 2022 16:00:36 GMT" text="I needed a simple routine to call when I wanted to read a feed. "></outline>
|
|
26
24
|
</outline>
|
|
27
|
-
<outline created="
|
|
28
|
-
<outline created="
|
|
29
|
-
<outline text="<%includeExample ("example1")%>"></outline>
|
|
30
|
-
<outline created="Mon, 07 Mar 2022 15:10:30 GMT" text="Here's <a href="https://github.com/scripting/reallysimple/blob/main/example/test.json">the file</a> that's created when you run that code. "></outline>
|
|
25
|
+
<outline created="Thu, 17 Mar 2022 15:42:49 GMT" text="#### What formats are supported?">
|
|
26
|
+
<outline created="Thu, 17 Mar 2022 15:42:57 GMT" text="RSS, Atom, and RDF."></outline>
|
|
31
27
|
</outline>
|
|
32
28
|
<outline created="Mon, 07 Mar 2022 15:25:06 GMT" text="#### What we build on">
|
|
33
29
|
<outline created="Mon, 07 Mar 2022 15:25:07 GMT" text="Thanks to Dan MacTough for the <a href="https://www.npmjs.com/package/feedparser">feedparser</a> package."></outline>
|
|
34
|
-
<outline created="Mon, 07 Mar 2022 15:25:33 GMT" text="It also builds on the davefeedread package, which simplifies the programming interface to feedparser."></outline>
|
|
35
|
-
<outline created="Thu, 17 Mar 2022 15:46:06 GMT" text="This package further simplifies the struct returned by <a href="https://www.npmjs.com/package/davefeedread">davefeedread</a>."></outline>
|
|
36
|
-
</outline>
|
|
37
|
-
<outline created="Sat, 05 Mar 2022 17:30:26 GMT" text="#### Work notes">
|
|
38
|
-
<outline created="Thu, 07 Apr 2022 15:37:15 GMT" text="4/7/22; 11:37:16 AM by DW">
|
|
39
|
-
<outline created="Thu, 07 Apr 2022 15:37:17 GMT" text="Clean up the readme file. Simplify the example app. Review docs. Start to invite collaborators to the repo, still private."></outline>
|
|
40
|
-
</outline>
|
|
41
|
-
<outline created="Mon, 21 Mar 2022 14:19:22 GMT" text="3/21/22; 10:19:22 AM by DW">
|
|
42
|
-
<outline created="Mon, 21 Mar 2022 14:19:22 GMT" text="Reviewing the way we represent links in items in the API. "></outline>
|
|
43
|
-
<outline created="Mon, 21 Mar 2022 14:27:17 GMT" text="The question is this -- how can we get a link to the item from the item. "></outline>
|
|
44
|
-
<outline created="Mon, 21 Mar 2022 14:27:44 GMT" text="The answer, on reflection -- rely on the link element as the permalink. "></outline>
|
|
45
|
-
</outline>
|
|
46
|
-
<outline created="Mon, 07 Mar 2022 15:27:46 GMT" text="3/7/22; 10:27:47 AM by DW">
|
|
47
|
-
<outline created="Mon, 07 Mar 2022 15:27:47 GMT" text="Start the reallysimple repo. Publish the NPM package. "></outline>
|
|
48
|
-
</outline>
|
|
49
|
-
<outline created="Sun, 06 Mar 2022 16:27:50 GMT" text="3/6/22; 11:27:52 AM by DW">
|
|
50
|
-
<outline created="Sun, 06 Mar 2022 16:27:53 GMT" text="It now understands various elements from the source namespace, including source:account, source:localtime and source:outline."></outline>
|
|
51
|
-
<outline created="Sun, 06 Mar 2022 16:28:33 GMT" text="Started a new private GitHub repo for the project and saved the files. "></outline>
|
|
52
|
-
<outline created="Sun, 06 Mar 2022 16:29:01 GMT" text="Added it to my NPM sub-menu, this is going to be a supported project."></outline>
|
|
53
|
-
</outline>
|
|
54
30
|
</outline>
|
|
55
31
|
<outline created="Mon, 07 Mar 2022 15:26:41 GMT" text="#### Comments, questions?">
|
|
56
|
-
<outline created="Mon, 07 Mar 2022 15:26:47 GMT" text="
|
|
32
|
+
<outline created="Mon, 07 Mar 2022 15:26:47 GMT" text="Post comments and questions in the <a href="https://github.com/scripting/reallysimple/issues/new">issues section</a> of this repo."></outline>
|
|
57
33
|
</outline>
|
|
58
34
|
</body>
|
|
59
35
|
</opml>
|
package/reallysimple.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var myProductName = "reallysimple"; myVersion = "0.4.
|
|
1
|
+
var myProductName = "reallysimple"; myVersion = "0.4.8";
|
|
2
2
|
|
|
3
3
|
exports.readFeed = readFeed;
|
|
4
4
|
exports.convertFeedToOpml = convertFeedToOpml;
|
|
@@ -15,6 +15,9 @@ const allowedHeadNames = [
|
|
|
15
15
|
const allowedItemNames = [
|
|
16
16
|
"title", "link", "description", "author", "category", "comments", "enclosures", "guid", "pubDate", "source", "source:outline", "source:likes"
|
|
17
17
|
];
|
|
18
|
+
const allowedEnclosureNames = [
|
|
19
|
+
"url", "type", "length"
|
|
20
|
+
];
|
|
18
21
|
|
|
19
22
|
var config = {
|
|
20
23
|
timeOutSecs: 3
|
|
@@ -160,6 +163,11 @@ function convertFeed (oldFeed) {
|
|
|
160
163
|
delete newFeed.image;
|
|
161
164
|
}
|
|
162
165
|
}
|
|
166
|
+
if (newFeed.cloud !== undefined) { //6/11/22 by DW
|
|
167
|
+
if (isEmptyObject (newFeed.cloud)) {
|
|
168
|
+
delete newFeed.cloud;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
163
171
|
|
|
164
172
|
newFeed.items = new Array ();
|
|
165
173
|
oldFeed.items.forEach (function (item) {
|
|
@@ -194,6 +202,21 @@ function convertFeed (oldFeed) {
|
|
|
194
202
|
delete newItem.source;
|
|
195
203
|
}
|
|
196
204
|
}
|
|
205
|
+
|
|
206
|
+
if (newItem.enclosure !== undefined) { //6/11/22 by DW
|
|
207
|
+
var enc = new Object ();
|
|
208
|
+
for (var x in newItem.enclosure) {
|
|
209
|
+
allowedEnclosureNames.forEach (function (name) {
|
|
210
|
+
if (x == name) {
|
|
211
|
+
if (newItem.enclosure [x] != null) {
|
|
212
|
+
enc [x] = newItem.enclosure [x];
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
newItem.enclosure = enc;
|
|
218
|
+
}
|
|
219
|
+
|
|
197
220
|
newFeed.items.push (newItem);
|
|
198
221
|
});
|
|
199
222
|
|