ns-rss-spider 0.0.25 → 0.0.26

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.
Files changed (2) hide show
  1. package/dist/cjs/parse.js +16 -19
  2. package/package.json +1 -1
package/dist/cjs/parse.js CHANGED
@@ -58,27 +58,24 @@ async function parseRss(name, feed, server) {
58
58
  });
59
59
  console.log("after num", result.items.length);
60
60
  }
61
- if (!result.items.length) {
62
- return {
63
- contents: []
64
- };
65
- }
66
61
  const contents = [];
67
62
  const strategy = import_strategy.strategies[name];
68
- result.items.forEach((item) => {
69
- if (!item.guid) {
70
- item.guid = item.link;
71
- }
72
- });
73
- for (let item of result.items) {
74
- console.log(import_zx.chalk.green(`正在解析文章 【${item.title}】`));
75
- if (!item.guid) {
76
- console.log(JSON.stringify(item));
77
- throw Error(`item has no guid`);
78
- }
79
- const content = await (0, import_parseContent.parseContent)(item, strategy).catch((e) => console.error(import_zx.chalk.red("文章解析失败"), e));
80
- if (content) {
81
- contents.push(content);
63
+ if (result.items.length) {
64
+ result.items.forEach((item) => {
65
+ if (!item.guid) {
66
+ item.guid = item.link;
67
+ }
68
+ });
69
+ for (let item of result.items) {
70
+ console.log(import_zx.chalk.green(`正在解析文章 【${item.title}】`));
71
+ if (!item.guid) {
72
+ console.log(JSON.stringify(item));
73
+ throw Error(`item has no guid`);
74
+ }
75
+ const content = await (0, import_parseContent.parseContent)(item, strategy).catch((e) => console.error(import_zx.chalk.red("文章解析失败"), e));
76
+ if (content) {
77
+ contents.push(content);
78
+ }
82
79
  }
83
80
  }
84
81
  let thumbs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ns-rss-spider",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/cjs/index.d.ts",