介绍
# Blog to Kindle
抓取博客/文章网站,编译成带封面的 EPUB,并传送到 Kindle。
## 快速开始
```bash # 1. Fetch essays from a supported site uv run scripts/fetch_blog.py --site paulgraham --output ./pg-essays
# 2. Generate cover (uses Nano Banana Pro) # See nano-banana-pro skill for cover generation
# 3. Compile to EPUB with cover uv run scripts/compile_epub.py --input ./pg-essays --cover ./cover.png --output essays.epub
# 4. Send to Kindle uv run scripts/send_to_kindle.py --file essays.epub --kindle-email [email protected] ```
## 工作流(必须按此顺序)
1. **获取** - 从博客下载所有文章/帖子 2. **生成封面** - 通过 Nano Banana Pro 技能创建封面(**请勿跳过**) 3. **编译** - 结合封面并组合成 EPUB 4. **发送** - 发邮件至 Kindle 地址
⚠️ **发送前务必生成并包含封面。** 绝不要在没有封面的情况下发送。
## 支持的网站
| 网站 | Key | URL 模式 | |------|-----|-------------| | Paul Graham | `paulgraham` | paulgraham.com/articles.html | | Kevin Kelly | `kevinkelly` | kk.org/thetechnium | | Derek Sivers | `sivers` | sive.rs/blog | | Wait But Why | `waitbutwhy` | waitbutwhy.com/archive | | Astral Codex Ten | `acx` | astralcodexten.com |
对于未列出的网站,使用 `--site custom --url <archive-url>`。
## 封面生成
使用 `nano-banana-pro` 技能生成封面。提示词模板:
``` Book cover for '[Author Name]: [Subtitle]'. Minimalist design with elegant typography. [Brand color] accent. Clean white/cream background. Simple geometric or abstract motif related to [topic]. Professional literary feel. No photos, no faces. Portrait orientation book cover dimensions. ```
以 2K 分辨率生成,以在保证良好质量的同时控制文件大小。
## Kindle 投递
默认 Kindle 地址 (Simon): `[email protected]`
使用 AppleScript 通过 Mail.app 发送。请确保: - 发件人邮箱在 Kindle 认可列表中 - 文件小于 50MB(EPUB 压缩效果很好)
## 状态追踪
状态文件存储在 `~/.clawdbot/state/blog-kindle/` 中: - `{site}-last-fetch.json` - 上次抓取时间戳、文章数量 - `{site}-sent.json` - 已发送文章 ID 列表
用于增量更新(仅抓取新帖子)。
## 手动工作流(无脚本)
如果脚本不可用,请遵循以下模式:
1. **获取**: curl 存档页面 → 解析文章链接 → 逐个获取 → 转换为 markdown 2. **合并**: 连接 markdown 并添加 YAML frontmatter(标题、作者) 3. **封面**: 通过 Nano Banana Pro 生成 4. **转换**: `pandoc combined.md -o output.epub --epub-cover-image=cover.png --toc` 5. **发送**: 使用 AppleScript 控制 Mail.app 添加附件发送
详细步骤请参阅 `references/manual-workflow.md`。