ns-rss-spider 0.0.11 → 0.0.12
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
|
@@ -42,6 +42,12 @@ async function parseRss(name, feed, server) {
|
|
|
42
42
|
const parser = new import_rss_parser.default();
|
|
43
43
|
console.log(import_zx.chalk.green("正在拉取 rss 列表"));
|
|
44
44
|
const result = await parser.parseURL(feed);
|
|
45
|
+
if (server == null ? void 0 : server.latest) {
|
|
46
|
+
const d = new Date(server.latest.pubDate);
|
|
47
|
+
result.items = result.items.filter((item) => {
|
|
48
|
+
return new Date(item.pubDate) >= d && item.guid !== server.latest.guid;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
45
51
|
if (!result.items.length) {
|
|
46
52
|
throw Error("rss no conent");
|
|
47
53
|
}
|
|
@@ -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.12",
|
|
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"
|