Files
inspiration-collector/README.md

94 lines
2.9 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.

# 灵感收集器 (Inspiration Collector)
手机随手记灵感 → AI 自动整理 → Gitea 交付
## 数据流向
```
手机 Memos App / Web
服务器 Memos 实例 (memo.xybkwd.top)
Python 脚本 + DeepSeek API
ai-insights/daily/ 中的 .md 文件
git push → Gitea (fxy/inspiration-collector)
你通过 nav.xybkwd.top 或 Gitea Web 直接阅读
```
> Obsidian 已从工作流中移除。所有产出在 Gitea 上直接获取。
## 目录结构
```
inspiration-collector/
├── ai-insights/ # AI 生成的报告git 追踪)
│ ├── daily/ # 每日灵感摘要(含待办提取)
│ └── weekly/ # 每周灵感趋势
├── tools/ # 核心工具模块
│ ├── llm.py # DeepSeek API 客户端
│ ├── memos_client.py # Memos 数据读取Connect RPC
│ ├── config.py # 配置加载
│ ├── formatter.py # Markdown 输出格式化
│ └── deepseek_balance.py # 余额查询(导航页用)
├── analyzers/ # 分析逻辑
│ ├── daily_digest.py # 每日分析
│ └── weekly_trend.py # 每周分析
├── scripts/ # 自动化脚本
│ ├── run_daily_digest.sh
│ ├── run_weekly_trend.sh
│ ├── todo_server.py # 待办 API导航页待办系统后端
│ ├── extract_todos.py # 从灵感摘要提取待办
│ ├── extract_all_todos.py # 全量待办提取
│ ├── fetch_news.py # 每日要闻抓取
│ ├── summarize_news.py # AI 新闻摘要
│ ├── daily_brief_gen.py # 每日简报生成
│ └── deepseek_balance.py # 余额查询
├── secrets/ # 密钥不入库chmod 600
│ ├── .gitignore
│ └── secrets.json.template
├── CHANGELOG.md # 版本记录
└── README.md
```
## 部署步骤
### 服务器上
```bash
# 克隆仓库
git clone http://localhost:3000/fxy/inspiration-collector.git
# 配置密钥
cp secrets/secrets.json.template secrets/secrets.json
vim secrets/secrets.json # 填入 DeepSeek API Key 和 Memos Token
chmod 600 secrets/secrets.json
# 测试运行
python3 analyzers/daily_digest.py
# 设置 cron
crontab -e
# 每日 22:00 北京时间
0 14 * * * /home/ubuntu/inspiration-collector/scripts/run_daily_digest.sh
# 每周日 16:00 北京时间
0 8 * * 0 /home/ubuntu/inspiration-collector/scripts/run_weekly_trend.sh
```
### 阅读产出
打开以下任一方式:
1. **导航页** `nav.xybkwd.top` → 每日要闻 / 待办事项
2. **Gitea Web** `gitea.xybkwd.top/fxy/inspiration-collector`
3. **直接服务器** `cat ~/inspiration-collector/ai-insights/daily/YYYY-MM-DD_digest.md`
### 依赖
- Python 3.10+
- `requests` / `feedparser` / `httpx`
- DeepSeek API Key余额 ¥10 约可用 3-6 个月)
- 自托管 Memos 实例