diff --git a/apps/rssPush.js b/apps/rssPush.js new file mode 100644 index 0000000..e69de29 diff --git a/config/default.json b/config/default.json index a4201c9..3b49ad8 100644 --- a/config/default.json +++ b/config/default.json @@ -9,6 +9,13 @@ "wsReConnectInterval": "5000", "token": "" }, + "feeds": [ + { + "url": "", + "targetGroups": [114,154], + "screenshot": true + } + ], "fanqieConfig": { "url": "http://127.0.0.1:6868", "outDir": "/home/user/debian/cache/Downloads" diff --git a/constants/path.js b/constants/path.js index c6ee14d..4e2ad4f 100644 --- a/constants/path.js +++ b/constants/path.js @@ -19,6 +19,7 @@ const Path = { pkg: path.join(rootDir, 'package.json'), yunzai: path.join(rootDir, '../../'), data: path.join(rootDir, '../../data/crystelf/data'), + rssHTML: path.join(rootDir, 'constants/rss/rss_template.html'), }; const configFile = fs.readFileSync(Path.defaultConfig, 'utf8'); diff --git a/constants/rss/rss_template.html b/constants/rss/rss_template.html new file mode 100644 index 0000000..235fe92 --- /dev/null +++ b/constants/rss/rss_template.html @@ -0,0 +1,43 @@ + + + +
+ + + + + + + diff --git a/lib/rss/screenshot.js b/lib/rss/screenshot.js new file mode 100644 index 0000000..3d06b03 --- /dev/null +++ b/lib/rss/screenshot.js @@ -0,0 +1,34 @@ +import fs from 'fs'; +import paths from './../../constants/path.js'; +import puppeteer from 'puppeteer'; + +const screenshot = { + /** + * 调用浏览器截图 + * @param title 标题 + * @param link 链接 + * @param description 描述 + * @returns {Promise