reallysimple 0.4.2 → 0.4.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": "Reads an RSS-like feed and calls back with a JavaScript structure, hiding all the history. It really is simple. ;-)",
4
- "version": "0.4.2",
4
+ "version": "0.4.3",
5
5
  "author": "Dave Winer <dave@scripting.com>",
6
6
  "license": "MIT",
7
7
  "files": [
package/readme.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  JavaScript code to read a feed. Calls back with a JavaScript structure, hiding all the history.
4
4
 
5
+ #### What formats are supported?
6
+
7
+ RSS, Atom, and RDF.
8
+
5
9
  #### Why?
6
10
 
7
11
  To make reading a feed from a JavaScript app as easy as possible.
@@ -14,10 +18,6 @@ I needed to simplify feed reading for the scripting system in Drummer. For scrip
14
18
 
15
19
  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.
16
20
 
17
- #### What formats are supported?
18
-
19
- RSS, Atom, and RDF.
20
-
21
21
  #### A coding example
22
22
 
23
23
  Here's how you call the 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>&lt;%dateModified%></dateModified>
5
+ <dateModified>Sun, 20 Mar 2022 15:42:26 GMT</dateModified>
6
6
  <expansionState></expansionState>
7
7
  <vertScrollState>1</vertScrollState>
8
8
  <windowTop>300</windowTop>
@@ -14,6 +14,9 @@
14
14
  <outline created="Sat, 05 Mar 2022 16:54:15 GMT" text="# reallysimple">
15
15
  <outline created="Mon, 07 Mar 2022 15:05:45 GMT" text="JavaScript code to read a feed. Calls back with a JavaScript structure, hiding all the history."></outline>
16
16
  </outline>
17
+ <outline created="Thu, 17 Mar 2022 15:42:49 GMT" text="#### What formats are supported?">
18
+ <outline created="Thu, 17 Mar 2022 15:42:57 GMT" text="RSS, Atom, and RDF."></outline>
19
+ </outline>
17
20
  <outline text="#### Why?">
18
21
  <outline created="Thu, 17 Mar 2022 15:40:05 GMT" text="To make reading a feed from a JavaScript app as easy as possible. "></outline>
19
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>
@@ -21,9 +24,6 @@
21
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>
22
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>
23
26
  </outline>
24
- <outline created="Thu, 17 Mar 2022 15:42:49 GMT" text="#### What formats are supported?">
25
- <outline created="Thu, 17 Mar 2022 15:42:57 GMT" text="RSS, Atom, and RDF."></outline>
26
- </outline>
27
27
  <outline created="Mon, 07 Mar 2022 15:11:02 GMT" text="#### A coding example">
28
28
  <outline created="Mon, 07 Mar 2022 15:11:09 GMT" text="Here's how you call the package."></outline>
29
29
  <outline created="Mon, 07 Mar 2022 15:12:02 GMT" text="const reallysimple = require (&quot;reallysimple&quot;);"></outline>
package/reallysimple.js CHANGED
@@ -1,4 +1,4 @@
1
- var myProductName = "reallysimple"; myVersion = "0.4.2";
1
+ var myProductName = "reallysimple"; myVersion = "0.4.3";
2
2
 
3
3
  exports.readFeed = readFeed;
4
4
  exports.convertFeedToOpml = convertFeedToOpml;
@@ -12,7 +12,7 @@ const allowedHeadNames = [
12
12
  "generator", "docs", "cloud", "ttl", "image", "rating", "textInput", "skipHours", "skipDays", "source:account", "source:localtime"
13
13
  ];
14
14
  const allowedItemNames = [
15
- "title", "link", "description", "author", "category", "comments", "enclosure", "guid", "pubDate", "source", "source:outline", "source:likes"
15
+ "title", "link", "description", "author", "category", "comments", "enclosures", "guid", "pubDate", "source", "source:outline", "source:likes"
16
16
  ];
17
17
 
18
18
  var config = {
@@ -153,7 +153,14 @@ function convertFeed (oldFeed) {
153
153
  newItem.outline = val;
154
154
  }
155
155
  else {
156
- newItem [x] = val;
156
+ if (x == "enclosures") {
157
+ if (item.enclosures.length > 0) {
158
+ newItem.enclosure = item.enclosures [0];
159
+ }
160
+ }
161
+ else {
162
+ newItem [x] = val;
163
+ }
157
164
  }
158
165
  }
159
166
  });