ns-rss-spider 1.0.2 → 1.0.4
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/cli.js +2 -1
- package/dist/cjs/parsers/techrunch.js +22 -27
- package/package.json +1 -1
package/dist/cjs/cli.js
CHANGED
|
@@ -50,11 +50,12 @@ async function main() {
|
|
|
50
50
|
}
|
|
51
51
|
if (process.env.DISP_ARGV) {
|
|
52
52
|
console.info("写入结果文件");
|
|
53
|
-
|
|
53
|
+
await (0, import_promises.writeFile)("./result.json", JSON.stringify(rst || {}));
|
|
54
54
|
} else {
|
|
55
55
|
console.info("输出结果");
|
|
56
56
|
console.log(rst);
|
|
57
57
|
}
|
|
58
|
+
console.log("done");
|
|
58
59
|
}
|
|
59
60
|
main().catch((err) => {
|
|
60
61
|
console.error(import_zx.chalk.red(err.message));
|
|
@@ -22,9 +22,6 @@ __export(techrunch_exports, {
|
|
|
22
22
|
techrunch: () => techrunch
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(techrunch_exports);
|
|
25
|
-
var import_zx = require("zx");
|
|
26
|
-
var import_constants = require("../utils/constants");
|
|
27
|
-
var import_browser = require("../utils/browser");
|
|
28
25
|
var techrunch = {
|
|
29
26
|
parse: true,
|
|
30
27
|
fetcher: "http",
|
|
@@ -32,30 +29,28 @@ var techrunch = {
|
|
|
32
29
|
const el = $(".article-content");
|
|
33
30
|
return el;
|
|
34
31
|
},
|
|
35
|
-
ignoreProbeImage: true
|
|
36
|
-
getThumbs: async (items) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return void 0;
|
|
58
|
-
}
|
|
32
|
+
ignoreProbeImage: true
|
|
33
|
+
//getThumbs: async (items) => {
|
|
34
|
+
// const url = 'https://techcrunch.com/';
|
|
35
|
+
// const initialState = await runInPage(url, async (page) => {
|
|
36
|
+
// const data = await page.evaluate(async () => (window as any).tc_app_data);
|
|
37
|
+
// return data;
|
|
38
|
+
// } , {
|
|
39
|
+
// userAgent: iosUA,
|
|
40
|
+
// }).catch(e => {
|
|
41
|
+
// console.error(chalk.red(`获取 ${url} 错误`), e);
|
|
42
|
+
// });
|
|
43
|
+
// if (initialState?.entities?.posts?.length) {
|
|
44
|
+
// const idThumbKv = (initialState.entities.posts as Array<any>).reduce<Record<string, string>>((prev, item) => {
|
|
45
|
+
// if (item?.guid?.rendered && item.jetpack_featured_media_url) {
|
|
46
|
+
// prev[item.guid.rendered] = item.jetpack_featured_media_url;
|
|
47
|
+
// }
|
|
48
|
+
// return prev;
|
|
49
|
+
// }, {});
|
|
50
|
+
// return idThumbKv;
|
|
51
|
+
// }
|
|
52
|
+
// return undefined;
|
|
53
|
+
//}
|
|
59
54
|
};
|
|
60
55
|
// Annotate the CommonJS export names for ESM import in node:
|
|
61
56
|
0 && (module.exports = {
|