reallysimple 0.5.0 → 0.5.2

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.0",
4
+ "version": "0.5.2",
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.0";
1
+ var myProductName = "reallysimple", myVersion = "0.5.2";
2
2
 
3
3
  exports.readFeed = readFeed;
4
4
  exports.convertFeedToOpml = convertFeedToOpml;
@@ -23,6 +23,8 @@ const allowedEnclosureNames = [
23
23
  "url", "type", "length"
24
24
  ];
25
25
 
26
+ const wpNamespace = "com-wordpress:feed-additions:1"; //8/22/25 by DW
27
+
26
28
  var config = {
27
29
  timeOutSecs: 10
28
30
  }
@@ -72,6 +74,15 @@ function emojiProcess (s) {
72
74
  }
73
75
  return (emoji.emojify (s, undefined, addSpan));
74
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
+ }
75
86
 
76
87
  function convertFeedToOpml (theFeed) { //use this if you want to show an RSS feed in an outline
77
88
  var theOutline = {
@@ -179,12 +190,12 @@ function convertFeed (oldFeed, whenstart) {
179
190
  const linkToNamespaces = linkToSite ["@"];
180
191
  var flFoundNamespace = false;
181
192
  for (var x in linkToNamespaces) {
182
- if (linkToNamespaces [x] == "com-wordpress:feed-additions:1") {
193
+ if (linkToNamespaces [x] == wpNamespace) {
183
194
  flFoundNamespace = true;
184
195
  }
185
196
  }
186
197
  if (flFoundNamespace) {
187
- newFeed.wpSiteId = linkToSite ["#"];
198
+ newFeed.wpSiteId = stringToNum (linkToSite ["#"]);
188
199
  }
189
200
  }
190
201
  }
@@ -279,12 +290,12 @@ function convertFeed (oldFeed, whenstart) {
279
290
  const linkToNamespaces = linkToPostId ["@"];
280
291
  var flFoundNamespace = false;
281
292
  for (var x in linkToNamespaces) {
282
- if (linkToNamespaces [x] == "com-wordpress:feed-additions:1") {
293
+ if (linkToNamespaces [x] == wpNamespace) {
283
294
  flFoundNamespace = true;
284
295
  }
285
296
  }
286
297
  if (flFoundNamespace) {
287
- newItem.wpPostId = linkToPostId ["#"];
298
+ newItem.wpPostId = stringToNum (linkToPostId ["#"]);
288
299
  }
289
300
  }
290
301
 
package/worknotes.md CHANGED
@@ -1,10 +1,14 @@
1
- #### 8/22/25; 9:30:06 AM by DW -- v0.5.0
1
+ #### 8/23/25; 10:54:38 AM by DW
2
+
3
+ wpSiteId and wpPostId are now numbers.
4
+
5
+ #### 8/22/25; 9:30:06 AM by DW -- v0.5.1
2
6
 
3
7
  We now look for the wordpress site id and post id, if present...
4
8
 
5
9
  * the site id is saved at the top level of the jstruct with the name wpSiteId
6
10
 
7
- * the post ide is saved in the item with the name wpPostId
11
+ * the post id is saved in the item with the name wpPostId
8
12
 
9
13
  This facilitates the Edit This Page function in wordpress editors, such as WordLand.
10
14