reallysimple 0.4.16 → 0.4.19

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 CHANGED
@@ -1,11 +1,12 @@
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.16",
4
+ "version": "0.4.19",
5
5
  "author": "Dave Winer <dave@scripting.com>",
6
6
  "license": "MIT",
7
7
  "files": [
8
- "reallysimple.js"
8
+ "reallysimple.js",
9
+ "worknotes.md"
9
10
  ],
10
11
  "main": "reallysimple.js",
11
12
  "repository": {
@@ -13,6 +14,8 @@
13
14
  "url": "https://github.com/scripting/reallysimple.git"
14
15
  },
15
16
  "dependencies" : {
17
+ "marked": "*",
18
+ "node-emoji": "*",
16
19
  "opml": "*",
17
20
  "daveutils": "*",
18
21
  "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>Sat, 11 Jun 2022 20:01:27 GMT</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 &lt;a href=&quot;http://feeder.scripting.com/returnjson?feedurl=https%3A%2F%2Frss.nytimes.com%2Fservices%2Fxml%2Frss%2Fnyt%2FTheater.xml&quot;&gt;demo app&lt;/a&gt; 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 &lt;a href=&quot;https://www.npmjs.com/package/feedparser&quot;&gt;feedparser&lt;/a&gt; package."></outline>
30
33
  </outline>
package/reallysimple.js CHANGED
@@ -1,4 +1,4 @@
1
- var myProductName = "reallysimple", myVersion = "0.4.16";
1
+ var myProductName = "reallysimple", myVersion = "0.4.19";
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: {
@@ -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.markdowntext = markdowntext; //8/25/22 by DW
248
+ }
249
+
231
250
  newFeed.items.push (newItem);
232
251
  });
233
252
 
package/worknotes.md ADDED
@@ -0,0 +1,92 @@
1
+ # Worknotes
2
+
3
+ #### 8/25/22 by DW -- v0.4.19
4
+
5
+ We now return the markdowntext for items that have the source:markdown element.
6
+
7
+ We needed this because [app] strips markup from descriptions, by providing markdowntext, we will have a way to regenerate it. The idea is that we can let through the styling that Markdown implements, it's harmless, where the garbage many feeds put in their text is intolerable.
8
+
9
+ #### 7/18/22 by DW -- v0.4.17
10
+
11
+ If we see a source:markdown element, we generate the description by processing the markdown text.
12
+
13
+ #### 7/14/22 by DW -- v0.4.16
14
+
15
+ Created a new item-level value called permalink. Previously we were getting the permalink and overwriting the guid value. Which is all well and good if the guid is a permalink. It's possible it's not, as illustrated by <a href="http://xmlviewer.scripting.com/?url=http%3A%2F%2Fscripting.com%2Fuserfeeds%2Fdavewiner.xml">this feed</a>, where it's just an id, not a permalink, in which case we overwrite the guid with undefined. Not really good behavior. So now instead of doing that we copy it into the permalink value.
16
+
17
+ #### 7/2/22 by DW -- v0.4.15
18
+
19
+ Added a new <i>reader</i> section to the returned object, containing information that's not from the feed, rather is about the feed reader software. The first element of this object is ctSecsToRead which is the number of seconds it took to read the feed. Also included the name of the reader app and version.
20
+
21
+ #### 6/23/22 by DW -- v0.4.11
22
+
23
+ New exported function reallySimple.setConfig.
24
+
25
+ Right now there is just one item in its config, timeoutSecs.
26
+
27
+ We need to change it in the feeder app, and there may be other config elements to change in the future, so let's do this right.
28
+
29
+ Also change the default from 3 to 10.
30
+
31
+ #### 6/20/22 by DW -- v0.4.10
32
+
33
+ Fixed a syntax error on the first line of reallysimple.js, changing a semicolon to a comma.
34
+
35
+ Oddly, this is not seen as a syntax error in my Node, whereas Scott's is reporting an error.
36
+
37
+ It's not good syntax no matter what. :smile:
38
+
39
+ #### 6/15/22 by DW -- v0.4.9
40
+
41
+ If a feed has an &lt;atom:link> head-level element with rel="self", we add a head-level linkToSelf value with its value.
42
+
43
+ A <a href="http://scripting.com/2022/06/15.html#a163715">blog post</a> on this addition.
44
+
45
+ #### 6/12/22 by DW
46
+
47
+ <a href="https://github.com/scripting/feeder">Feeder</a> is a server app that connects to the <a href="https://github.com/scripting/reallysimple">reallysimple</a> package via the web.
48
+
49
+ #### 6/11/22 by DW -- v0.4.8
50
+
51
+ Announced on <a href="http://scripting.com/2022/06/11.html#a193356">Scripting News</a> and <a href="https://twitter.com/davewiner/status/1535708039621353472">Twitter</a>.
52
+
53
+ If the cloud element exists but is empty, delete it.
54
+
55
+ Only allow url, type and length properties in enclosure objects.
56
+
57
+ Don't pass through enclosure properties whose value is null.
58
+
59
+ #### 6/5/22 by DW
60
+
61
+ Put together the <a href="http://reallysimple.org/twentyYearsAgo.opml">notes</a> on how RSS 0.94 became RSS 2.0 in the summer of 2002.
62
+
63
+ Added a menubar to the reallysimple.org website, to organize the various projects.
64
+
65
+ #### 5/17/22 by DW
66
+
67
+ If an object is undefined there's no need to delete it.
68
+
69
+ #### 4/7/22 by DW
70
+
71
+ Clean up the readme file. Simplify the example app. Review docs. Start to invite collaborators to the repo, still private.
72
+
73
+ #### 3/21/22 by DW
74
+
75
+ Reviewing the way we represent links in items in the API.
76
+
77
+ The question is this -- how can we get a link to the item from the item.
78
+
79
+ The answer, on reflection -- rely on the link element as the permalink.
80
+
81
+ #### 3/7/22 by DW
82
+
83
+ Start the reallysimple repo. Publish the NPM package.
84
+
85
+ #### 3/6/22 by DW
86
+
87
+ It now understands various elements from the source namespace, including source:account, source:localtime and source:outline.
88
+
89
+ Started a new private GitHub repo for the project and saved the files.
90
+
91
+ Added it to my NPM sub-menu, this is going to be a supported project.
92
+