X 书签归档器:自动归档 Twitter - Openclaw Skills
作者:互联网
2026-04-13
什么是 X 书签归档器?
X 书签归档器是一款先进的工具,旨在将转瞬即逝的社交媒体互动转化为结构化的永久知识库。通过集成 bird CLI 和 OpenAI,这个 Openclaw Skills 库的补充组件可以自动提取、展开和总结您的 X 书签。它通过将书签转换为分类的 Markdown 文件,完美契合任何开发者的本地文档工作流,从而解决了“书签丢失”的问题。
对于将 X 作为主要发现引擎,但需要更可靠的方式来存储和查询所发现信息的开发者和研究人员来说,这项技能尤其有价值。它利用现代 AI 提供上下文感知摘要,确保您的归档链接在原始帖子从时间线消失后很久仍然有用。
下载入口:https://github.com/openclaw/skills/tree/main/skills/iamadig/x-bookmark-archiver
安装与下载
1. ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install x-bookmark-archiver
2. 手动安装
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
3. 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 x-bookmark-archiver。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
X 书签归档器 应用场景
- 为在 X 上发现的研究论文和技术文章创建永久的本地备份。
- 构建开发者工具和 GitHub 仓库的精选库,供离线参考。
- 自动总结长推文串或链接内容,以节省审阅时间。
- 通过 Openclaw Skills 将社交媒体上的发现集成到 Obsidian 或 Logseq 等个人知识管理 (PKM) 系统中。
- 获取:使用 bird CLI 从您认证的 X 账号中下载最新的 50 条书签。
- 过滤:将获取的项目与本地状态文件进行对比,识别并跳过已处理的书签。
- 展开:将 t.co 短链接解析为原始目标 URL,以确保准确的域名分析。
- 分类:根据预定义的域名模式列表,自动将书签映射到工具、研究或新闻等特定文件夹。
- 丰富:利用 OpenAI 根据推文内容生成描述性标题、简洁摘要和相关标签。
- 写入:将处理后的数据保存到组织良好的 Markdown 文件中,支持完整的 YAML frontmatter。
- 追踪:更新本地 JSON 状态文件,以维护已处理 ID 的准确记录,实现增量同步。
X 书签归档器 配置指南
安装 bird CLI 并确保您已通过 X 账号认证。设置您的 OpenAI API 密钥,以便为您的 Openclaw Skills 工作区启用 AI 生成的摘要。
# 安装 bird CLI 并认证
bird --version
# 配置环境
export OPENAI_API_KEY="sk-..."
# 运行完整的归档流水线
node skills/x-bookmark-archiver/scripts/run.cjs
X 书签归档器 数据架构与分类体系
该技能在 X-knowledge 目录下组织数据,根据内容类型使用子文件夹结构。每个文件都包含用于元数据追踪的 YAML frontmatter。
| 字段 | 描述 |
|---|---|
| title | AI 生成或原始页面标题 |
| type | 基于域名的分类(工具、文章、视频等) |
| date_archived | 归档过程的 ISO 时间戳 |
| source_tweet | 原始 X/T@witter URL |
| link | 解析后的目标 URL |
| tags | AI 提取的关键词数组 |
X Bookmark Archiver
Archive your X (T@witter) bookmarks into categorized markdown files with AI-generated summaries.
Overview
This skill fetches your X bookmarks using the bird CLI, categorizes them by URL patterns, generates AI summaries using OpenAI, and saves them as organized markdown files.
Prerequisites
- bird CLI - Install from steipete/bird
- OpenAI API Key (optional) - Set
OPENAI_API_KEYfor AI-generated summaries - Node.js 18+
Installation
# Ensure bird CLI is installed and authenticated
bird --version
# Set OpenAI API key (optional, for AI summaries)
export OPENAI_API_KEY="sk-..."
Commands
run - Full Pipeline
Fetches new bookmarks and processes them:
node skills/x-bookmark-archiver/scripts/run.cjs
run --force - Process Existing
Skip fetch, process only pending bookmarks:
node skills/x-bookmark-archiver/scripts/run.cjs --force
fetch - Download Bookmarks Only
node skills/x-bookmark-archiver/scripts/fetch.cjs
process - Archive Pending Only
node skills/x-bookmark-archiver/scripts/process.cjs
Category Mapping
Bookmarks are automatically categorized based on URL patterns:
| Category | Domains |
|---|---|
| tools | github.com, gitlab.com, github.io, huggingface.co, replicate.com, vercel.com, npmjs.com, pypi.org |
| articles | medium.com, substack.com, dev.to, hashnode.dev, x.com/i/article, blog.*, towardsdatascience.com |
| videos | you@tube.com, youtu.be, vimeo.com, twitch.tv |
| research | arxiv.org, paperswithcode.com, semanticscholar.org, researchgate.net, dl.acm.org, ieee.org |
| news | techcrunch.com, theverge.com, hn.algolia.com, news.ycombinator.com, wired.com, arstechnica.com |
| bookmarks | fallback for unmatched URLs |
Output Location
Markdown files are created in the OpenClaw workspace at:
Legacy installs (old name):
~/clawd/X-knowledge/
New installs:
~/.openclaw/workspace/X-knowledge/
With profile (OPENCLAW_PROFILE=prod):
~/.openclaw/workspace-prod/X-knowledge/
Override with environment variable:
export OPENCLAW_WORKSPACE=/custom/path
node skills/x-bookmark-archiver/scripts/run.cjs
# Creates: /custom/path/X-knowledge/
Output Structure
~/.openclaw/workspace/X-knowledge/
├── tools/
│ ├── awesome-ai-project.md
│ └── useful-cli-tool.md
├── articles/
│ ├── how-to-build-x.md
│ └── ml-best-practices.md
├── videos/
│ └── conference-talk.md
├── research/
│ └── attention-is-all-you-need.md
├── news/
│ └── latest-tech-announcement.md
└── bookmarks/
└── misc-link.md
Markdown Template
Each archived bookmark gets a markdown file with frontmatter:
---
title: "Awesome AI Project"
type: tool
date_archived: 2026-01-31
source_tweet: https://x.com/i/web/status/1234567890
link: https://github.com/user/repo
tags: ["ai", "machine-learning", "github"]
---
This project implements a novel approach to... (AI-generated summary)
State Management
State files track processing progress:
/root/clawd/.state/
├── x-bookmark-pending.json # Bookmarks waiting to be processed
└── x-bookmark-processed.json # IDs of already-archived bookmarks
Environment Variables
| Variable | Required | Description |
|---|---|---|
OPENAI_API_KEY |
No | API key for AI-generated summaries |
Workflow
- Fetch: Downloads latest 50 bookmarks from X
- Filter: Removes already-processed bookmarks
- Expand: Resolves t.co shortened URLs
- Categorize: Assigns category based on URL domain
- Enrich: Generates title, summary, tags (AI or fallback)
- Write: Saves as markdown in
X-knowledge/{category}/ - Track: Updates processed IDs, clears pending
Customization
Adding Categories
Edit scripts/lib/categorize.cjs:
const CATEGORIES = {
tools: ['github.com', '...'],
your_category: ['example.com', '...'],
// ...
};
Changing Output Directory
Edit scripts/process.cjs:
const KNOWLEDGE_DIR = 'your-directory-name';
Using Different AI Provider
Modify the generateMetadata() function in scripts/process.cjs to use your preferred API.
Testing
Run the test suite:
# Run all tests
cd skills/x-bookmark-archiver/tests
node test-all.cjs
# Run individual test suites
node lib/categorize.test.cjs
node lib/state.test.cjs
node integration.test.cjs
Test Coverage
- Unit tests:
categorize.js(21 tests) - URL pattern matching - Unit tests:
state.js(9 tests) - JSON read/write operations - Integration tests (12 tests) - Full pipeline with mock data
Manual Testing
Without bird CLI, you can test with mock data:
# Create mock pending data
cat > /tmp/test-pending.json << 'EOF'
[
{
"id": "test123",
"url": "https://github.com/test/repo",
"text": "Test bookmark"
}
]
EOF
# Copy to state directory and process
mkdir -p /root/clawd/.state
cp /tmp/test-pending.json /root/clawd/.state/x-bookmark-pending.json
node skills/x-bookmark-archiver/scripts/process.cjs
Troubleshooting
| Issue | Solution |
|---|---|
bird: command not found |
Install bird CLI from GitHub releases |
| No bookmarks fetched | Ensure you're logged into X in bird |
| AI summaries not generating | Check OPENAI_API_KEY is set |
| t.co links not expanding | May be network/timeout issues; will use original URL |
File Structure
skills/x-bookmark-archiver/
├── SKILL.md
├── scripts/
│ ├── fetch.cjs # Download bookmarks from X (CommonJS)
│ ├── process.cjs # Generate markdown files (CommonJS)
│ ├── run.cjs # Orchestrate fetch → process (CommonJS)
│ └── lib/
│ ├── categorize.cjs # URL → category mapping (CommonJS)
│ └── state.cjs # JSON state management (CommonJS)
└── tests/
├── test-all.cjs
├── lib/
│ ├── categorize.test.cjs
│ │ └── state.test.cjs
├── integration.test.cjs
└── fixtures/
└── sample-bookmarks.json
License
MIT
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
阿里云大模型服务平台百炼新人免费额度如何申请?申请与使用免费额度教程及常见问题解答
办公 AI 工具 OpenClaw 部署 Windows 系统一站式教程
Qwen3.6 正式发布!阿里云百炼同步开启“AI大模型节省计划”超值优惠
【新手零难度操作 】OpenClaw 2.6.4 安装误区规避与快速使用指南(包含最新版安装包)
OpenClaw 2.6.4 可视化部署 打造个人 AI 数字员工(包含最新版安装包)
【小白友好!】OpenClaw 2.6.4 本地 AI 智能体快速搭建教程(内有安装包)
零基础部署 OpenClaw v2.6.2,Windows 系统完整教程
【适合新手的】零基础部署 OpenClaw 自动化工具教程
开发者们的第一台自主进化的“爱马仕”来了
极简部署 OpenClaw 2.6.2 本地 AI 智能体快速启用(含最新版安装包)
AI精选
