ns-rss-spider 0.0.11 → 0.0.13
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/dist/cjs/parse.js
CHANGED
|
@@ -45,6 +45,15 @@ async function parseRss(name, feed, server) {
|
|
|
45
45
|
if (!result.items.length) {
|
|
46
46
|
throw Error("rss no conent");
|
|
47
47
|
}
|
|
48
|
+
if (server == null ? void 0 : server.latest) {
|
|
49
|
+
const d = new Date(server.latest.pubDate);
|
|
50
|
+
result.items = result.items.filter((item) => {
|
|
51
|
+
return new Date(item.pubDate) >= d && item.guid !== server.latest.guid;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (!result.items.length) {
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
48
57
|
const contents = [];
|
|
49
58
|
for (let item of result.items) {
|
|
50
59
|
console.log(import_zx.chalk.green(`正在解析文章 【${item.title}】`));
|
|
@@ -7,7 +7,7 @@ export interface ServerInfo {
|
|
|
7
7
|
pubDate: Date;
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
-
export declare function uploadContent({ app, getUploadApi,
|
|
10
|
+
export declare function uploadContent({ app, getUploadApi, items, }: {
|
|
11
11
|
app: string;
|
|
12
12
|
items: Article[];
|
|
13
13
|
} & ServerInfo): Promise<Article[] | {
|
package/dist/cjs/upload/index.js
CHANGED
|
@@ -39,18 +39,14 @@ var import_zx = require("zx");
|
|
|
39
39
|
async function uploadContent({
|
|
40
40
|
app,
|
|
41
41
|
getUploadApi,
|
|
42
|
-
latest,
|
|
43
42
|
items
|
|
44
43
|
}) {
|
|
45
44
|
var _a, _b;
|
|
46
|
-
const filterItems = latest ? items.filter((item) => {
|
|
47
|
-
return item.pubDate >= latest.pubDate && item.guid !== latest.guid;
|
|
48
|
-
}) : items;
|
|
49
45
|
if (!getUploadApi) {
|
|
50
|
-
return
|
|
46
|
+
return items;
|
|
51
47
|
}
|
|
52
48
|
let result = [];
|
|
53
|
-
for (let item of
|
|
49
|
+
for (let item of items) {
|
|
54
50
|
console.log(import_zx.chalk.green("start", item.title));
|
|
55
51
|
console.log(import_zx.chalk.green("正在获取上传地址"));
|
|
56
52
|
const uploadRst = await import_axios.default.post(getUploadApi, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ns-rss-spider",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"build:deps": "father prebundle",
|
|
12
12
|
"check": "father doctor",
|
|
13
13
|
"prepublishOnly": "father doctor && npm run build",
|
|
14
|
-
"
|
|
14
|
+
"sync": "echo '去更新 registry 版本: https://www.npmmirror.com/sync/ns-rss-spider'",
|
|
15
|
+
"pub": "npm run check && npm version patch && npm run build && npm publish --registry=https://registry.npmjs.org && git push origin master --tags && npm run sync"
|
|
15
16
|
},
|
|
16
17
|
"bin": {
|
|
17
18
|
"ns-rss-spider": "./dist/cjs/cli.js"
|