X Bookmarks Digest
Fetch, analyse, and digest your X/Twitter bookmarks into actionable insights.
When to Use
Activate this skill when the user says anything like:
- - "digest x bookmarks"
- "check my bookmarks"
- "review my x bookmarks"
- "what's interesting in my bookmarks?"
- "bookmark digest"
- "any good stuff in my twitter bookmarks?"
Prerequisites Check
Before running the workflow, verify xurl authentication:
CODEBLOCK0
If 401/Unauthorized:
Tell the user to set up xurl authentication:
xurl auth apps add <app-name> --client-id <id> --client-secret <secret>
Then run
xurl auth default <app-name> to set it as default.
Do NOT proceed until auth works. Stop and report the issue.
Workflow — Step by Step
Step 1: Check Rate Limit
Read the state file to check when the last run was:
CODEBLOCK2
If last_run_ts is less than 1 hour ago, warn the user:
"Last digest was run at {time}. Free tier allows max 1 run/hour. Use --force to override."
Only proceed if:
- - No previous run exists, OR
- More than 1 hour has elapsed, OR
- User explicitly says to force/override
Step 2: Fetch Bookmarks
Run the fetch script to get new bookmarks:
CODEBLOCK3
Options:
- -
--count N — number of bookmarks to fetch (default 50, max 100) - INLINECODE3 — skip rate limit check
- INLINECODE4 — fetch all (ignore last-checked ID, reprocess everything)
Output: JSON array of bookmark objects to stdout.
Side effect: Updates {baseDir}/state.json with new watermark.
If the output is empty or [], report: "No new bookmarks since last check."
Step 3: Analyse Bookmarks
Pipe the fetched bookmarks through the analyser:
CODEBLOCK4
Or if you saved fetch output to a variable, pass it via file:
CODEBLOCK5
Output: Structured JSON with categories and relevance scores:
CODEBLOCK6
Step 4: Generate Digest
Using the structured analysis output, write a digest following this format:
CODEBLOCK7
Step 5: Decide on Actions
For each high-value bookmark, decide:
| Bookmark Type | Action |
|---|
| GitHub repo / tool | Propose git clone or INLINECODE8 |
| Clawhub-compatible skill |
Propose
clawhub install <slug> |
|
Interesting project to build | Propose scaffolding a new skill in
skills/ |
|
Useful article/thread | Propose saving to Obsidian vault |
|
Tip/technique | Propose saving to OpenClaw memory |
Ask the user which actions to execute. Do not auto-execute without confirmation.
Step 6: Update State
After successful digest, verify state was updated:
CODEBLOCK8
Should show updated last_bookmark_id and last_run_ts.
Error Handling
| Problem | Action |
|---|
| xurl not found | Tell user: INLINECODE13 |
| xurl 401 |
Guide user through
xurl auth apps add setup |
|
xurl 429 (rate limit) | Report rate limit hit. Suggest waiting 15 mins. |
|
Empty bookmarks | Report "No bookmarks found" — user may need to bookmark posts first |
|
No new bookmarks | Report "No new bookmarks since {last
runts}" |
|
state.json missing | First run — create fresh state after fetch |
|
Python error | Print stderr, check Python 3.10+ installed |
Test Commands
Quick test (dry run, no state update):
CODEBLOCK9
Or just say: "digest x bookmarks" to run the full workflow.
Configuration
All config is in {baseDir}/state.json:
- -
last_bookmark_id — watermark for incremental fetches - INLINECODE17 — rate limit enforcement
- INLINECODE18 — running total of processed bookmarks
No additional configuration files needed. xurl manages its own auth.
X Bookmarks Digest
获取、分析并提炼你的X/Twitter书签,转化为可执行的洞察。
使用时机
当用户说出以下类似内容时,激活此技能:
- - 整理x书签
- 查看我的书签
- 回顾我的x书签
- 我的书签里有什么有趣的?
- 书签摘要
- 我的推特书签里有什么好东西?
前置条件检查
在运行工作流之前,验证xurl认证:
bash
xurl whoami
如果返回401/未授权:
告知用户设置xurl认证:
xurl auth apps add <应用名称> --client-id --client-secret <密钥>
然后运行 xurl auth default <应用名称> 将其设为默认。
在认证成功之前不要继续。停止并报告问题。
工作流 — 逐步执行
步骤1:检查速率限制
读取状态文件,检查上次运行时间:
bash
cat {baseDir}/state.json 2>/dev/null || echo {lastbookmarkid: null, lastrunts: null, processed_count: 0}
如果 lastrunts 距离现在不足1小时,警告用户:
上次摘要运行时间为 {time}。免费版每小时最多运行1次。使用 --force 可覆盖限制。
仅在以下情况继续:
- - 没有之前的运行记录,或者
- 已超过1小时,或者
- 用户明确要求强制/覆盖
步骤2:获取书签
运行获取脚本以获取新书签:
bash
python3 {baseDir}/scripts/fetch_bookmarks.py --count 50
选项:
- - --count N — 获取书签数量(默认50,最大100)
- --force — 跳过速率限制检查
- --all — 获取全部(忽略上次检查的ID,重新处理所有内容)
输出: 书签对象的JSON数组到标准输出。
副作用: 用新的水印更新 {baseDir}/state.json。
如果输出为空或 [],报告:自上次检查以来没有新书签。
步骤3:分析书签
将获取的书签通过分析器处理:
bash
python3 {baseDir}/scripts/fetchbookmarks.py --count 50 | python3 {baseDir}/scripts/analysebookmarks.py
或者如果你将获取输出保存到变量,通过文件传递:
bash
python3 {baseDir}/scripts/analyse_bookmarks.py --file /tmp/bookmarks.json
输出: 带有分类和相关度评分的结构化JSON:
json
{
summary: {total: 50, new: 12, high: 4, medium: 5, low: 3},
bookmarks: [
{
id: 123,
text: ...,
author: @user,
category: tool,
relevance: 5,
urls: [https://github.com/...],
github_repos: [user/repo],
keywords: [python, cli]
}
]
}
步骤4:生成摘要
使用结构化分析输出,按照以下格式编写摘要:
markdown
X Bookmarks Digest — {日期}
摘要
- - 共检查 {total} 个书签,{new} 个新书签
- 高价值 {high} 个,中等价值 {medium} 个,低价值 {low} 个
高价值(相关度4-5)
[{分类}] {标题或关键主题}
@{作者}: {文本前100个字符}...
- - 链接:{提取的URL}
- 价值:{1行价值说明}
- 行动:{具体下一步}
中等价值(相关度3)
{相同格式,更简洁}
建议行动
- 1. [ ] {行动1}
- [ ] {行动2}
...
步骤5:决定行动
对于每个高价值书签,决定:
| 书签类型 | 行动 |
|---|
| GitHub仓库/工具 | 建议 git clone 或 brew install |
| Clawhub兼容技能 |
建议 clawhub install
|
| 值得构建的有趣项目 | 建议在 skills/ 中搭建新技能框架 |
| 有用的文章/帖子 | 建议保存到Obsidian笔记库 |
| 技巧/技术 | 建议保存到OpenClaw记忆 |
询问用户要执行哪些行动。未经确认不要自动执行。
步骤6:更新状态
成功生成摘要后,验证状态已更新:
bash
cat {baseDir}/state.json
应显示更新后的 lastbookmarkid 和 lastrunts。
错误处理
| 问题 | 行动 |
|---|
| 未找到xurl | 告知用户:brew install xurl |
| xurl 401 |
引导用户完成 xurl auth apps add 设置 |
| xurl 429(速率限制) | 报告达到速率限制。建议等待15分钟。 |
| 书签为空 | 报告未找到书签——用户可能需要先收藏帖子 |
| 没有新书签 | 报告自 {lastrunts} 以来没有新书签 |
| state.json缺失 | 首次运行——获取后创建新的状态 |
| Python错误 | 打印标准错误,检查是否安装了Python 3.10+ |
测试命令
快速测试(空运行,不更新状态):
bash
测试xurl认证
xurl whoami
测试获取(小批量)
python3 {baseDir}/scripts/fetch_bookmarks.py --count 5 --force
测试分析(使用样本数据)
echo [{id:1,text:看看这个超棒的CLI工具 https://github.com/user/repo,authorusername:devuser,createdat:2026-03-19T10:00:00Z}] | python3 {baseDir}/scripts/analyse_bookmarks.py
完整流水线测试
python3 {baseDir}/scripts/fetchbookmarks.py --count 10 --force | python3 {baseDir}/scripts/analysebookmarks.py
或者直接说:整理x书签 来运行完整工作流。
配置
所有配置都在 {baseDir}/state.json 中:
- - lastbookmarkid — 增量获取的水印
- lastrunts — 速率限制执行
- processed_count — 已处理书签的运行总数
无需额外配置文件。xurl管理自己的认证。