reallysimple 0.4.15 → 0.4.18
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 +3 -1
- package/readme.md +4 -0
- package/readme.opml +4 -1
- package/reallysimple.js +21 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
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.18",
|
|
5
5
|
"author": "Dave Winer <dave@scripting.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"files": [
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
"url": "https://github.com/scripting/reallysimple.git"
|
|
14
14
|
},
|
|
15
15
|
"dependencies" : {
|
|
16
|
+
"marked": "*",
|
|
17
|
+
"node-emoji": "*",
|
|
16
18
|
"opml": "*",
|
|
17
19
|
"daveutils": "*",
|
|
18
20
|
"davefeedread": "*"
|
package/readme.md
CHANGED
|
@@ -18,6 +18,10 @@ I needed a simple routine to call when I wanted to read a feed.
|
|
|
18
18
|
|
|
19
19
|
RSS, Atom, and RDF.
|
|
20
20
|
|
|
21
|
+
#### Demo
|
|
22
|
+
|
|
23
|
+
Here's a <a href="http://feeder.scripting.com/returnjson?feedurl=https%3A%2F%2Frss.nytimes.com%2Fservices%2Fxml%2Frss%2Fnyt%2FTheater.xml">demo app</a> that runs a feed through reallySimple.
|
|
24
|
+
|
|
21
25
|
#### What we build on
|
|
22
26
|
|
|
23
27
|
Thanks to Dan MacTough for the <a href="https://www.npmjs.com/package/feedparser">feedparser</a> package.
|
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>Thu, 28 Jul 2022 14:17:15 GMT</dateModified>
|
|
6
6
|
<expansionState></expansionState>
|
|
7
7
|
<vertScrollState>1</vertScrollState>
|
|
8
8
|
<windowTop>300</windowTop>
|
|
@@ -25,6 +25,9 @@
|
|
|
25
25
|
<outline created="Thu, 17 Mar 2022 15:42:49 GMT" text="#### What formats are supported?">
|
|
26
26
|
<outline created="Thu, 17 Mar 2022 15:42:57 GMT" text="RSS, Atom, and RDF."></outline>
|
|
27
27
|
</outline>
|
|
28
|
+
<outline created="Thu, 28 Jul 2022 14:15:48 GMT" text="#### Demo">
|
|
29
|
+
<outline created="Thu, 28 Jul 2022 14:15:51 GMT" text="Here's a <a href="http://feeder.scripting.com/returnjson?feedurl=https%3A%2F%2Frss.nytimes.com%2Fservices%2Fxml%2Frss%2Fnyt%2FTheater.xml">demo app</a> that runs a feed through reallySimple. "></outline>
|
|
30
|
+
</outline>
|
|
28
31
|
<outline created="Mon, 07 Mar 2022 15:25:06 GMT" text="#### What we build on">
|
|
29
32
|
<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>
|
|
30
33
|
</outline>
|
package/reallysimple.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var myProductName = "reallysimple", myVersion = "0.4.
|
|
1
|
+
var myProductName = "reallysimple", myVersion = "0.4.18";
|
|
2
2
|
|
|
3
3
|
exports.readFeed = readFeed;
|
|
4
4
|
exports.convertFeedToOpml = convertFeedToOpml;
|
|
@@ -9,6 +9,8 @@ const request = require ("request");
|
|
|
9
9
|
const process = require ("process");
|
|
10
10
|
const opml = require ("opml");
|
|
11
11
|
const davefeedread = require ("davefeedread");
|
|
12
|
+
const marked = require ("marked"); //7/18/22 by DW
|
|
13
|
+
const emoji = require ("node-emoji"); //7/18/22 by DW
|
|
12
14
|
|
|
13
15
|
const allowedHeadNames = [
|
|
14
16
|
"title", "link", "description", "language", "copyright", "managingEditor", "webMaster", "lastBuildDate", "pubDate", "category",
|
|
@@ -58,6 +60,17 @@ function getItemPermalink (item) {
|
|
|
58
60
|
}
|
|
59
61
|
return (undefined);
|
|
60
62
|
}
|
|
63
|
+
function markdownProcess (markdowntext) {
|
|
64
|
+
var htmltext = marked.parse (markdowntext);
|
|
65
|
+
return (htmltext);
|
|
66
|
+
}
|
|
67
|
+
function emojiProcess (s) {
|
|
68
|
+
function addSpan (code, name) {
|
|
69
|
+
return ("<span class=\"spRssEmoji\">" + code + "</span>");
|
|
70
|
+
}
|
|
71
|
+
return (emoji.emojify (s, undefined, addSpan));
|
|
72
|
+
}
|
|
73
|
+
|
|
61
74
|
function convertFeedToOpml (theFeed) { //use this if you want to show an RSS feed in an outline
|
|
62
75
|
var theOutline = {
|
|
63
76
|
opml: {
|
|
@@ -207,7 +220,7 @@ function convertFeed (oldFeed, whenstart) {
|
|
|
207
220
|
});
|
|
208
221
|
}
|
|
209
222
|
}
|
|
210
|
-
newItem.
|
|
223
|
+
newItem.permalink = getItemPermalink (item); //7/14/22 by DW
|
|
211
224
|
if (newItem.source !== undefined) { //5/17/22 by DW
|
|
212
225
|
if (isEmptyObject (newItem.source)) {
|
|
213
226
|
delete newItem.source;
|
|
@@ -228,6 +241,12 @@ function convertFeed (oldFeed, whenstart) {
|
|
|
228
241
|
newItem.enclosure = enc;
|
|
229
242
|
}
|
|
230
243
|
|
|
244
|
+
if (item ["source:markdown"] !== undefined) { //7/18/22 by DW
|
|
245
|
+
let markdowntext = item ["source:markdown"] ["#"];
|
|
246
|
+
newItem.description = markdownProcess (emojiProcess (markdowntext));
|
|
247
|
+
newItem.markdown = markdowntext; //8/25/22 by DW
|
|
248
|
+
}
|
|
249
|
+
|
|
231
250
|
newFeed.items.push (newItem);
|
|
232
251
|
});
|
|
233
252
|
|