Files
InfoFlow/README.md

68 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# info_flow
一个用于总结微信文章并生成投资策略的项目。
## **功能:**
* 抓取微信文章内容
* 利用 Gemini API 总结文章
* 根据文章内容生成短、中、长线投资策略 (如果文章是投资主题)
* 将总结和投资策略保存到 Markdown 文件
## **技术栈:**
* [Bun](https://bun.sh):快速的 all-in-one JavaScript 运行时
* [Elysia.js](https://elysiajs.com/)Web 框架
* [Google Gemini API](https://ai.google.dev/):用于生成文本
* [JSDOM](https://github.com/jsdom/jsdom):在 Node.js 中模拟 DOM 环境
* [Cheerio](https://github.com/cheeriojs/cheerio):快速灵活的 HTML 解析器
## **安装依赖:**
```bash
bun install
```
## **运行项目:**
```bash
bun run index.ts
```
## **构建项目:**
```bash
bun build index.ts --outfile=dist/lockon --compile
```
## **运行构建后的项目:**
```bash
dist/lockon
```
## **项目结构:**
* `index.ts`Elysia.js 应用入口,包含路由和主要逻辑 (typescript:index.ts)
* `package.json`:项目依赖和脚本 (json:package.json)
* `jsconfig.json`TypeScript 配置文件 (json:jsconfig.json)
* `.gitignore`Git 忽略文件 (.gitignore)
* `global.d.ts`:全局类型声明 (typescript:global.d.ts)
* `history/`:存放历史总结和投资策略的目录
* `README.md`:项目介绍 (markdown:README.md)
## **环境变量:**
* `API_KEY`Google Gemini API 的 API 密钥
## **使用方法:**
1. 在根目录下创建 `.env` 文件,并添加 `API_KEY=YOUR_API_KEY`
2. 运行项目:`bun run index.js`
3. 在浏览器中打开 `http://localhost:3000`,输入微信文章链接,点击提交。
4. 总结和投资策略将保存在 `history/` 目录下,并显示在浏览器中。
## **贡献:**
欢迎提交 issue 和 pull request