X 收藏 → 本地知识库,让 AI 自动整理
在 X(Twitter)上刷到好东西,点一下就存到本地知识库,AI Agent 自动整理归类。
🦉 Chrome 扩展方案(推荐,小白首选) 🔧 CDP 脚本方案(适合 Agent 自动化)
适合人群:不想碰命令行的普通用户
点击页面右上角 Code → Download ZIP,解压到一个你找得到的地方,比如桌面。
- 进入解压后的文件夹 →
colab-server - 双击
colab-server.py - 第一次运行会弹出窗口,点"允许"
- 看到黑色窗口里显示
Serving on port 8765就成功了
💡 重要:这个窗口不要关!每次用扩展之前都要先打开它。
- 打开 Chrome,输入
chrome://extensions - 右上角开启 「开发者模式」
- 点击 「加载已解压的扩展程序」
- 选择
xcolab文件夹 →chrome-extension子文件夹 - 扩展图标 🦉 应该出现在 Chrome 工具栏
点扩展工具栏的 🦉 → 点右上角设置 ⚙️ → 填入你的知识库文件夹路径。
- 打开 X(twitter.com 或 x.com)
- 随便刷,看到有用的内容
- 点工具栏 🦉 图标
- 点 「扫描当前页面」
- 预览你找到的内容
- 再点一次按钮 「发送」
- 搞定!内容进了你的知识库
适合人群:想用 cron 自动跑、让 AI 每天整理一次的用户
- Python 3.8+
- Chrome 浏览器
- 已安装 Python 库:
pip install playwright && playwright install chromium
# 克隆仓库
git clone https://github.com/simonlin000/xcolab.git
cd xcolab
# 先跑一次 Colab Server(需要先运行)
python3 colab-server/colab-server.py &
# 运行扫描脚本
python3 scripts/x-scan.pycrontab -e加入这行(每天早上 9 点自动跑):
0 9 * * * /usr/bin/python3 /path/to/xcolab/scripts/x-scan.py >> /tmp/xcolab.log 2>&1
⚠️ 注意:cron 运行期间 Chrome 不能关!
编辑 scripts/config.json:
{
"chrome_port": 9222,
"chrome_user_data": "",
"keywords_zh": ["ai", "人工智能", "chatgpt", "claude"],
"keywords_en": ["gpt", "llm", "agent", "cursor"],
"vault_path": "~/Documents/你的知识库/X资源收藏"
}存入知识库的 Markdown 文件长这样:
---
source: x-extension
date: 2026-05-07
count: 3
---
# X 资源收藏
## 2026-05-07
### @username
这是一条 AI 相关的推文内容...
互动:100 浏览 | 20 喜欢
---A:先确认 colab-server.py 窗口是开着的。窗口关了就重新打开。
A:确保你在 X 的主页(For You 或 Following)或用户资料页,而不是单个推文页面。
A:右键 →「打开方式」→ 选择「Python」;或者打开终端,运行 python3 /path/to/colab-server.py
A:Chrome → chrome://extensions → 确保 xcolab 已启用 → 点击扩展图标旁的 🧩 → 在工具栏显示
A:打开 Obsidian 或任何 Markdown 编辑器,去知识库的 X资源收藏 目录里看。
# 检查服务是否运行
curl http://localhost:8765/health
# 返回 {"status": "ok"} = 正常
# 返回 connection refused = 服务没开# 查看最近存的记录
curl http://localhost:8765/status# 安装依赖
pip install playwright
playwright install chromium
# 测试脚本
python3 scripts/x-scan.py --dry-run
# 运行 Colab Server
python3 colab-server/colab-server.pyMIT · 免费商用 · 署名即可