bkrigmo1-bookmark-intelligence

TotalClaw 作者 totalclaw

将 X 书签转为可执行洞察,抓取文章、AI 分析并通过 Telegram 通知。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw skills install shop:totalclaw:totalclaw~bkrigmo1-bookmark-intelligence
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~bkrigmo1-bookmark-intelligence/file -o bkrigmo1-bookmark-intelligence.md
## 概述(中文)

将 X 书签转为可执行洞察,抓取文章、AI 分析并通过 Telegram 通知。

## 技能正文

# 🔖 书签智能

**自动将 X (Twitter) 书签转化为可执行洞察。**

书签智能监控你的 X 书签,抓取链接文章的完整内容,用 AI 分析一切,并浮现与你项目相关的想法。别让好内容躺在书签里 — 让 AI 为你提取价值。

---

## 💎 定价与层级

书签智能提供三个层级以满足你的需求:

### 🆓 免费版
**适合试用**
- **价格:** $0/月
- 每月 **10 个书签**
- 仅手动运行(无自动化)
- 基础关键词分析(无 AI)
- 无通知
- 速率限制:每小时 1 次

### ⭐ Pro 版 - $9/月
**适合个人用户**
- **无限书签**
- 自动监控(后台守护进程)
- 完整 AI 分析(GPT-4o-mini)
- Telegram 通知
- 优先支持

### 🚀 企业版 - $29/月
**面向团队与高级用户**
- Pro 版全部功能,另加:
- 团队共享与协作
- 自定义 AI 模型(自带 API 密钥)
- API 访问以集成
- Slack 与 Discord 通知
- Webhook 支持
- 专属支持

**提供年付方案** — 省 2 个月(16% 折扣)!

### 如何升级

1. **检查当前层级:**
   ```bash
   npm run license:check
   ```

2. **查看升级选项:**
   ```bash
   npm run license:upgrade
   ```

3. **选择支付方式:**
   - 信用卡 (Stripe)
   - 加密货币 (Polygon 上的 USDC)

4. **激活许可证:**
   ```bash
   node scripts/license.js activate YOUR-LICENSE-KEY
   ```

---

## 📋 快速开始

**总设置时间:约 5 分钟**

1. **运行设置向导:**
   ```bash
   cd skills/bookmark-intelligence
   npm run setup
   ```

2. **向导将:**
   - ✅ 检查是否已安装必需工具
   - 🍪 逐步引导获取 X cookies
   - 🎯 询问你的活跃项目与兴趣
   - ⚙️ 配置通知偏好
   - 🧪 测试你的凭证

3. **运行一次以处理当前书签:**
   ```bash
   npm start
   ```

4. **设为后台守护进程(可选但推荐):**
   ```bash
   npm run daemon
   ```

完成!🎉

---

## 🎯 功能说明

### 问题
你在 X 上收藏了大量好内容,但:
- 你从不回去读
- 推文链接到你没时间读的文章
- 你忘了为何收藏某条内容
- 你错过与当前项目的关联

### 解决方案
书签智能:
1. **监控** 你的 X 书签
2. **抓取** 链接文章的完整内容(不仅是推文)
3. **分析** 一切以提取关键概念与可执行项
4. **关联** 洞察到你的具体项目与兴趣
5. **通知** 你发现有价值内容时(通过 Telegram)
6. **存储** 一切到可搜索知识库

### 输出示例

你收藏关于「AI 记忆的向量嵌入」的推文 → 技能将:
- 抓取链接文章
- 提取:关键概念、可执行实现步骤、代码模式
- 关联到你的「交易机器人」与「智能体记忆」项目
- 建议:「将市场分析存为嵌入以发现历史模式」
- 将完整分析保存到 `life/resources/bookmarks/bookmark-123.json`
- 通过 Telegram 发送摘要通知

完整示例见 [examples/sample-analysis.json](examples/sample-analysis.json)。

---

## 🍪 获取 X Cookies(逐步)

你需要 X.com 的两个 cookie。放心,这很安全,约 2 分钟。

### Chrome / Edge / Brave

1. 在浏览器中打开 https://x.com
2. **确保已登录**
3. 按 **F12**(打开开发者工具)
4. 点击顶部 **Application** 标签
5. 在左侧边栏:
   - 展开 **Cookies**
   - 点击 **https://x.com**
6. 找到以下两个 cookie:
   - `auth_token` → 复制 **Value** 列
   - `ct0` → 复制 **Value** 列

```
┌─────────────────────────────────────────┐
│ Application  Console  Sources  ...     │ ← Click "Application"
├─────────────────────────────────────────┤
│ ▼ Storage                               │
│   ▼ Cookies                             │
│     ▶ https://x.com      ← Click this   │
│                                         │
│ Name          Value                     │
│ auth_token    abc123...  ← Copy this    │
│ ct0           xyz789...  ← Copy this    │
└─────────────────────────────────────────┘
```

### Firefox

1. Open https://x.com
2. Press **F12**
3. 点击 **Storage** 标签(非 "Application")
4. Expand **Cookies** → **https://x.com**
5. 复制 `auth_token` 与 `ct0` 值

### Safari

1. 启用开发者菜单:
   - Safari → Preferences → Advanced
   - Check "Show Develop menu in menu bar"
2. Go to https://x.com
3. 开发 → 显示 Web 检查器
4. Storage tab → Cookies → x.com
5. Copy `auth_token` and `ct0`

### ⚠️ 重要安全说明

- **这些 cookie 如同密码** — 可完全访问你的 X 账号
- **切勿与任何人分享**
- **不要发布到网上或提交到 git**
- 它们以严格权限 (600) 存储在本地 `.env` 中
- 会定期过期 — 需更新(技能会提示)

设置向导创建的 `.env` 文件如下:
```bash
AUTH_TOKEN=your_long_token_here
CT0=your_other_token_here
```

---

## 🛠️ 要求

### 必需
- **Node.js** v16+([在此下载](https://nodejs.org))
- **bird CLI** — X/Twitter 命令行工具
  ```bash
  npm install -g bird
  ```

### 可选(但推荐)
- **PM2** — 作为后台守护进程运行
  ```bash
  npm install -g pm2
  ```

设置向导会自动检查这一切!

---

## ⚙️ 配置

运行 `npm run setup` 后,你将有两个文件:

### 1. `.env` — 你的凭证
```bash
AUTH_TOKEN=your_token_here
CT0=your_ct0_here
```
**切勿提交此文件!** 已在 `.gitignore` 中。

### 2. `config.json` — 你的偏好
```json
{
  "credentialsFile": ".env",
  "bookmarkCount": 50,
  "checkIntervalMinutes": 60,
  "storageDir": "../../life/resources/bookmarks",
  "notifyTelegram": true,
  "contextProjects": [
    "trading bot",
    "agent memory",
    "your other projects..."
  ]
}
```

**关键设置:**
- `bookmarkCount` — 检查最近多少个书签(默认:50)
- `checkIntervalMinutes` — 检查新书签的频率(默认:60 分钟)
- `contextProjects` — **你的活跃项目** — 越具体,AI 分析越好!
- `notifyTelegram` — 高价值洞察通知(需要 OpenClaw)

可随时编辑 `config.json`。更改在下次运行时生效。

---

## 🚀 用法

### 运行一次(处理当前书签)
```bash
npm start
```
处理最近书签一次后退出。

### 测试模式(预览将发生什么)
```bash
npm test
```
显示将处理什么但不实际执行。

### 后台守护进程(推荐日常使用)
```bash
npm run daemon
```

在后台运行书签智能,每小时检查新书签(可配置)。

**管理守护进程:**
```bash
pm2 status bookmark-intelligence   # Check if it's running
pm2 logs bookmark-intelligence     # View recent logs
pm2 stop bookmark-intelligence     # Pause it
pm2 restart bookmark-intelligence  # Restart it
pm2 delete bookmark-intelligence   # Remove it completely
```

---

## 📂 文件存放位置

```
skills/bookmark-intelligence/
├── .env                    # Your credentials (SECRET - never commit!)
├── config.json             # Your preferences
├── bookmarks.json          # Processing state (tracks what's been analyzed)
├── monitor.js              # Main script
├── analyzer.js             # AI analysis engine
├── scripts/
│   ├── setup.js           # Setup wizard
│   └── uninstall.js       # Clean uninstall
└── examples/              # Sample outputs to show you what to expect

life/resources/bookmarks/   # ← Analyzed bookmarks saved here
├── bookmark-123.json
├── bookmark-456.json
└── ...
```

每个分析后的书签成为 JSON 文件,包含:
- 原始推文(作者、文本、互动统计)
- 完整分析(摘要、关键概念、可执行项)
- 针对你项目的实现建议
- 优先级
- 时间戳

---

## 🔔 通知(OpenClaw 集成)

若在 OpenClaw 内运行(非独立),可对高价值洞察获得 Telegram 通知。

**触发通知的条件:**
- `priority: "high"` AND
- `hasActionableInsights: true`

**你将收到:**
- 📚 内容摘要
- 🎯 可执行项列表
- 💡 关键概念
- 🔨 针对你项目的实现建议
- 🔗 原始推文链接

See [examples/sample-notification.md](examples/sample-notification.md) for a full example.

---

## 🧹 卸载

```bash
npm run uninstall
```

将:
1. 停止 PM2 守护进程(若在运行)
2. 删除凭证(`.env`)
3. 删除配置(`config.json`)
4. 删除处理状态(`bookmarks.json`)
5. **询问** 是否保留已分析书签

稍后重装只需再次运行 `npm run setup`。

---

## 🔧 故障排除

### 「Missing Twitter credentials」错误

**问题:** 技能找不到认证令牌。

**解决方案:**
1. Make sure you ran `npm run setup`
2. Check that `.env` exists in `skills/bookmark-intelligence/`
3. Check that `.env` has both `AUTH_TOKEN=` and `CT0=` lines

### 「No bookmarks fetched」或「unauthorized」错误

**问题:** cookie 无效或已过期。

**解决方案:**
1. Get fresh cookies from X.com (see instructions above)
2. Update `.env` with new values
3. Try running `npm test` to verify

**手动测试凭证:**
```bash
cd skills/bookmark-intelligence
source .env
bird whoami --json
```
若成功,凭证有效。

### 「bird: command not found」

**问题:** 未安装 bird CLI。

**解决方案:**
```bash
npm install -g bird
```

### 守护进程未运行/意外停止

**问题:** 可能未安装 PM2,或守护进程崩溃。

**解决方案:**
```bash
# Check PM2 is installed
pm2 --version

# If not, install it
npm install -g pm2

# Check daemon status
pm2 status

# View logs to see what happened
pm2 logs bookmark-intelligence

# Restart
npm run daemon
```

### 分析过于泛泛/不相关

**问题:** AI 不知道你关心什么。

**解决方案:**
1. Edit `config.json`
2. Update `contextProjects` with **specific** project descriptions:
   ```json
   "contextProjects": [
     "Building a crypto trading bot using Python and Binance API",
     "Learning Rust for systems programming",
     "Growing my SaaS to $10k MRR"
   ]
   ```
3. Restart: `pm2 restart bookmark-intelligence`

越具体,AI 越能将洞察关联到你的工作!

---

## 🔐 隐私与数据

**数据存储在哪?**
- 凭证:`.env`(本地文件,权限 600)
- 已分析书签:`life/resources/bookmarks/`(本地文件)
- 除以下外不向第三方发送任何数据:
  - X.com(获取书签)
  - OpenAI/Anthropic(AI 分析,若使用 OpenClaw LLM)
  - 链接网站(抓取文章内容)

**能否不用 OpenClaw?**
- 可以!可独立运行
- 无 LLM 分析(回退到关键词分析)
- 无 Telegram 通知
- 其余功能正常

**安全吗?**
- 凭证永不离开你的机器
- `.env` 在 `.gitignore` 中,不会误提交
- 文件权限设为 600(仅所有者可读写)
- 无遥测、无回传

---

## 🎨 自定义想法

熟悉基础后可自定义:

### 更改通知阈值
Edit `monitor.js` line ~120 to notify on `medium` priority too:
```javascript
if (config.notifyTelegram && (analysis.priority === 'high' || analysis.priority === 'medium')) {
```

### 处理更多书签
Edit `config.json`:
```json
{
  "bookmarkCount": 100  // Check last 100 bookmarks
}
```

### 更频繁检查
```json
{
  "checkIntervalMinutes": 30  // Check every 30 minutes
}
```

### 导出到 Notion / Obsidian
在 `scripts/export-to-notion.js` 添加导出脚本 — 每个书签已是干净的 JSON 结构!

---

## 📚 示例

见 `examples/` 文件夹:
- **sam