reallysimple 0.5.1 → 0.5.3

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,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.5.1",
4
+ "version": "0.5.3",
5
5
  "author": "Dave Winer <dave@scripting.com>",
6
6
  "license": "MIT",
7
7
  "files": [
package/reallysimple.js CHANGED
@@ -1,4 +1,4 @@
1
- var myProductName = "reallysimple", myVersion = "0.5.1";
1
+ var myProductName = "reallysimple", myVersion = "0.5.3";
2
2
 
3
3
  exports.readFeed = readFeed;
4
4
  exports.convertFeedToOpml = convertFeedToOpml;
@@ -74,6 +74,15 @@ function emojiProcess (s) {
74
74
  }
75
75
  return (emoji.emojify (s, undefined, addSpan));
76
76
  }
77
+ function stringToNum (theString) { //return a number if we can convert, otherwise return string -- 8/23/25 by DW
78
+ const num = Number (theString);
79
+ if (num == NaN) {
80
+ return (theString);
81
+ }
82
+ else {
83
+ return (num);
84
+ }
85
+ }
77
86
 
78
87
  function convertFeedToOpml (theFeed) { //use this if you want to show an RSS feed in an outline
79
88
  var theOutline = {
@@ -186,7 +195,7 @@ function convertFeed (oldFeed, whenstart) {
186
195
  }
187
196
  }
188
197
  if (flFoundNamespace) {
189
- newFeed.wpSiteId = linkToSite ["#"];
198
+ newFeed.wpSiteId = stringToNum (linkToSite ["#"]);
190
199
  }
191
200
  }
192
201
  }
@@ -272,7 +281,6 @@ function convertFeed (oldFeed, whenstart) {
272
281
 
273
282
  if (item ["source:markdown"] !== undefined) { //7/18/22 by DW
274
283
  let markdowntext = item ["source:markdown"] ["#"];
275
- newItem.description = markdownProcess (emojiProcess (markdowntext));
276
284
  newItem.markdowntext = markdowntext; //8/25/22 by DW
277
285
  }
278
286
 
@@ -286,7 +294,7 @@ function convertFeed (oldFeed, whenstart) {
286
294
  }
287
295
  }
288
296
  if (flFoundNamespace) {
289
- newItem.wpPostId = linkToPostId ["#"];
297
+ newItem.wpPostId = stringToNum (linkToPostId ["#"]);
290
298
  }
291
299
  }
292
300
 
package/worknotes.md CHANGED
@@ -1,3 +1,21 @@
1
+ #### 11/18/25; 8:09:33 AM by DW
2
+
3
+ In convertFeed, if there's a source:markdown element present in an item, we were changing the value of the item description to a rendered version of the markdown text. There's no comment explaining why we did this and it seems wrong. It might make some sense if there's no description element present.
4
+
5
+ This caused problems in the scripting.com/rss.xml feed because we were generating the markdown text from the description, and it was screwing up fediverse addresses that it thought was a mailto. Like @scripting@daveverse.org.
6
+
7
+ I commented the line of code out. It seems it should be up to the source of the feed to decide what the relationship is between the markdown text and the description.
8
+
9
+ #### 10/10/25; 11:13:23 AM by DW
10
+
11
+ We now look for site id and post id in wordpress-generated sites.
12
+
13
+ No we don't. I misunderstood, the id's are not present in the feeds, they are present in the API.
14
+
15
+ #### 8/23/25; 10:54:38 AM by DW
16
+
17
+ wpSiteId and wpPostId are now numbers.
18
+
1
19
  #### 8/22/25; 9:30:06 AM by DW -- v0.5.1
2
20
 
3
21
  We now look for the wordpress site id and post id, if present...