Iamadig

X Bookmarks Archiver

知識管理v1.0.0
作者:Iamadig更新於 2026-05-11x-bookmark-archiver@clawhub_iamadig/x-bookmark-archiver
資料整理摘要總結知識歸檔#Twitter

據 AlphaMoat 統計,截至 2026-09,X Bookmarks Archiver 累計下載 3,023 次、獲 2 個星標,在全部 5,078 個 AI 技能中排名第 3,713 位,在「知識管理」分類(442 個)中排名第 319 位。

累計安裝
223
累計下載
3023
星標
2
全站排名
#3,713
全站前 74% · 「知識管理」前 73%
平台累計安裝累計下載星標評論
ClawHub ↗8525502-
SkillHub ↗22330232—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

使用已登入的 bird CLI 取得新書籤,展開短網址、按網域分類並記錄處理狀態,避免重複歸檔。需要 Node.js 18 或更高版本;OpenAI 摘要為可選功能,未設定時使用備用內容。短網址展開失敗時保留原 URL。

資料釋出於 2026-10-26

可以用來做什麼

  • 把 X 書籤整理到本機知識目錄

什麼時候用

  • 需要按類別儲存新書籤和追蹤已處理條目時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

把新取得的 X 書籤按類別歸檔,並保留來源連結

使用條件

依據技能文件中的宣告整理,未經實際安裝或執行驗證。

鑑權說明
bird 需已登入 X;僅 AI 摘要需要 OPENAI_API_KEY。
配置要求
  • 輸出存於工作區的 X-knowledge/;可用 OPENCLAW_WORKSPACE 覆蓋工作區。

月度資料趨勢

累計下載3023
1884249631072026-03 · 累計下載 19682026-05 · 累計下載 21862026-06 · 累計下載 23152026-07 · 累計下載 25552026-08 · 累計下載 26672026-09 · 累計下載 302326-0326-09
星標2
1232026-03 · 星標 22026-05 · 星標 22026-06 · 星標 22026-07 · 星標 22026-08 · 星標 22026-09 · 星標 226-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-093023—2
2026-082667+4.4%2
2026-072555+10.4%2
2026-062315+5.9%2
2026-052186—2
2026-031968—2

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

6.3 KB · ClawHub v1.0.0
# X Bookmark Archiver

Archive your X (Twitter) bookmarks into categorized markdown files with AI-generated summaries.

## Overview

This skill fetches your X bookmarks using the [bird CLI](https://github.com/steipete/bird), categorizes them by URL patterns, generates AI summaries using OpenAI, and saves them as organized markdown files.

## Prerequisites
展開全部(共 260 行)
1. **bird CLI** - Install from [steipete/bird](https://github.com/steipete/bird)
2. **OpenAI API Key** (optional) - Set `OPENAI_API_KEY` for AI-generated summaries
3. **Node.js 18+**

## Installation

```bash
# 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:

```bash
node skills/x-bookmark-archiver/scripts/run.cjs
```

### `run --force` - Process Existing

Skip fetch, process only pending bookmarks:

```bash
node skills/x-bookmark-archiver/scripts/run.cjs --force
```

### `fetch` - Download Bookmarks Only

```bash
node skills/x-bookmark-archiver/scripts/fetch.cjs
```

### `process` - Archive Pending Only

```bash
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** | youtube.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:**
```bash
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:

```markdown
---
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

1. **Fetch**: Downloads latest 50 bookmarks from X
2. **Filter**: Removes already-processed bookmarks
3. **Expand**: Resolves t.co shortened URLs
4. **Categorize**: Assigns category based on URL domain
5. **Enrich**: Generates title, summary, tags (AI or fallback)
6. **Write**: Saves as markdown in `X-knowledge/{category}/`
7. **Track**: Updates processed IDs, clears pending

## Customization

### Adding Categories

Edit `scripts/lib/categorize.cjs`:

```javascript
const CATEGORIES = {
  tools: ['github.com', '...'],
  your_category: ['example.com', '...'],
  // ...
};
```

### Changing Output Directory

Edit `scripts/process.cjs`:

```javascript
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:

```bash
# 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:

```bash
# 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

「知識管理」分類下的熱門技能

Summarize知識管理

把長文字、文件與網頁內容壓縮成要點和關鍵詞的摘要工具。

↓ 65.5萬★ 1037paudyyin
ima-skills知識管理

ima skills,支援對筆記、知識庫的讀取、寫入和檢索等操作,可以幫你隨時記錄,收入ima智慧管理,隨時呼叫,龍蝦輸出精準懂你,友好的接入了OpenClaw生態,構建你的第二大腦。

↓ 42.4萬★ 542u_1742680f
web-tools-guide知識管理

MANDATORY before calling web_search, web_fetch, browser, or opencli. Contains required error-handling procedures (web_search failure → must guide user to configure API), fallback chain (opencli CLI covers 70+ sites as structured fallback before browser), and site-specific login URLs. Without reading this skill, you WILL handle failures incorrectly and miss available tools. Trigger on: 搜尋/上網/查資料/開啟網站/抓取網頁/新聞/熱點/web search/fetch/browser/opencli.

↓ 26.6萬★ 217user_ec205dbb
Baidu web search知識管理

使用百度AI搜尋引擎(BDSE)進行網路搜尋。適用於獲取即時資訊、文件資料或研究課題。

↓ 13.7萬★ 259ide-rea
Markdown Converter知識管理

用 uvx 直接呼叫 markitdown,把各類檔案轉成 Markdown。

↓ 10.5萬★ 254Peter Steinberger
Prismfy Web Search | Free Google知識管理

OpenClaw的預設網頁搜尋。使用Prismfy在10個搜尋引擎(Google、Reddit、GitHub、arXiv、Hacker News等)搜尋網路,含免費方案。

↓ 9.6萬★ 41Uroboros1205
Web Search知識管理

此技能用於搜尋網路資訊、查詢當前內容、查詢新聞文章、圖片或影片。它透過 DuckDuckGo 搜尋 API 以文字、Markdown 或 JSON 格式返回簡潔結果,適用於研究、事實核查、獲取最新資訊或收集網路資源。

↓ 8.4萬★ 52billyutw
Find Skills Skill知識管理

從多種來源搜尋和發現OpenClaw技能。使用場景:使用者想要查詢可用技能、搜尋特定功能或發現新技能。

↓ 8.2萬★ 166fangkelvin

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。