x-timeline-digest
Overview
This skill uses bird to read X/Twitter timelines and build a high-signal digest.
Sources:
- - For You timeline
- Following timeline
What it does:
- 1. Fetch recent tweets
- Filter incrementally (avoid reprocessing)
- Deduplicate (ID + near-duplicate text)
- Rank and trim
- Generate a Chinese digest
- Output a structured payload
Delivery (Telegram, email, etc.) is NOT handled here.
Upstream OpenClaw workflows decide how to notify users.
Configuration
All config is read from: skills.entries["x-timeline-digest"].config
Config fields
| Name | Type | Default | Description |
|---|
| intervalHours | number | 6 | Interval window in hours |
| fetchLimitForYou |
number | 100 | Tweets fetched from For You |
| fetchLimitFollowing | number | 60 | Tweets fetched from Following |
| maxItemsPerDigest | number | 25 | Max tweets in one digest |
| similarityThreshold | number | 0.9 | Near-duplicate similarity threshold |
| statePath | string | ~/.openclaw/state/x-timeline-digest.json | State file path |
Dependencies
- - bird must be installed and available in PATH
- bird must already be authenticated (cookie login)
- Read-only usage
Usage
1. Basic (Raw JSON)
Run the digest generator to get a clean, deduplicated JSON payload:
CODEBLOCK0
2. Intelligent Digest (Recommended)
To generate the "Smart Brief" (Categorized, Summarized, Denoised):
- 1. Run the script: INLINECODE0
- Read the prompt template: INLINECODE1
- Send the prompt to your LLM, injecting the content of
digest.json where {{JSON_DATA}} is.
Note: The script automatically applies heuristic filtering (removes "gm", ads, short spam) before outputting JSON.
Bird Commands Used
For You timeline:
bird home -n
--json
Following timeline:
bird home --following -n --json
State Management
State is persisted to statePath.
State structure
{
"lastRunAt": "2026-02-01T00:00:00+08:00",
"sentTweetIds": {
"123456789": "2026-02-01T00:00:00+08:00"
}
}
Rules
- - Tweets already in sentTweetIds must not be included again
- After a successful run:
- Update lastRunAt
- Add pushed tweet IDs to sentTweetIds
- Keep IDs for at least 30 days
Processing Pipeline
- 1. Fetch from For You and Following
- Incremental filter using lastRunAt
- Hard deduplication by tweet id
- Near-duplicate merge using text similarity
- Rank and trim to maxItemsPerDigest
- Generate a Categorized Chinese Digest (via PROMPT.md + LLM)
- Categories: 🤖 AI & Tech, 💰 Crypto & Markets, 💡 Insights, 🗞️ Other
- Language: Simplified Chinese
- Format: Author: Summary
- Denoising: Remove ads and low-value content
Output
The skill returns one JSON object:
{
"window": {
"start": "2026-02-01T00:00:00+08:00",
"end": "2026-02-01T06:00:00+08:00",
"intervalHours": 6
},
"counts": {
"forYouFetched": 100,
"followingFetched": 60,
"afterIncremental": 34,
"afterDedup": 26,
"final": 20
},
"digestText": "中文摘要内容",
"items": [
{
"id": "123456",
"author": "@handle",
"createdAt": "2026-02-01T02:15:00+08:00",
"text": "tweet text",
"url": "https://x.com/handle/status/123456",
"sources": ["following"]
}
]
}
x-timeline-digest
概述
该技能使用 bird 读取 X/Twitter 时间线,并构建高信号摘要。
数据来源:
功能:
- 1. 获取最新推文
- 增量过滤(避免重复处理)
- 去重(ID + 近似重复文本)
- 排序与裁剪
- 生成中文摘要
- 输出结构化数据
投递(Telegram、邮件等)不在此处处理。
由上游 OpenClaw 工作流决定如何通知用户。
配置
所有配置从以下位置读取:skills.entries[x-timeline-digest].config
配置字段
| 名称 | 类型 | 默认值 | 描述 |
|---|
| intervalHours | number | 6 | 时间窗口(小时) |
| fetchLimitForYou |
number | 100 | 从为你推荐获取的推文数 |
| fetchLimitFollowing | number | 60 | 从关注获取的推文数 |
| maxItemsPerDigest | number | 25 | 每份摘要的最大推文数 |
| similarityThreshold | number | 0.9 | 近似重复相似度阈值 |
| statePath | string | ~/.openclaw/state/x-timeline-digest.json | 状态文件路径 |
依赖
- - 必须安装 bird 并确保其在 PATH 中可用
- bird 必须已完成身份验证(cookie 登录)
- 只读使用
使用方法
1. 基础使用(原始 JSON)
运行摘要生成器以获取干净、去重的 JSON 数据:
bash
node skills/x-timeline-digest/digest.js
2. 智能摘要(推荐)
生成智能简报(分类、总结、降噪):
- 1. 运行脚本:node skills/x-timeline-digest/digest.js > digest.json
- 读取提示模板:read skills/x-timeline-digest/PROMPT.md
- 将提示发送给您的 LLM,并将 digest.json 的内容注入到 {{JSON_DATA}} 所在位置。
注意:脚本在输出 JSON 前会自动应用启发式过滤(移除gm、广告、短垃圾信息)。
使用的 Bird 命令
为你推荐时间线:
bird home -n
--json
关注时间线:
bird home --following -n --json
状态管理
状态持久化存储于 statePath。
状态结构
{
lastRunAt: 2026-02-01T00:00:00+08:00,
sentTweetIds: {
123456789: 2026-02-01T00:00:00+08:00
}
}
规则
- - 已存在于 sentTweetIds 中的推文不得再次包含
- 成功运行后:
- 更新 lastRunAt
- 将已推送的推文 ID 添加到 sentTweetIds
- 保留 ID 至少 30 天
处理流程
- 1. 从为你推荐和关注中获取推文
- 使用 lastRunAt 进行增量过滤
- 按推文 ID 进行硬去重
- 使用文本相似度进行近似重复合并
- 排序并裁剪至 maxItemsPerDigest
- 生成分类中文摘要(通过 PROMPT.md + LLM)
- 分类:🤖 AI 与技术、💰 加密与市场、💡 洞见、🗞️ 其他
- 语言:简体中文
- 格式:作者:摘要
- 降噪:移除广告和低价值内容
输出
该技能返回一个 JSON 对象:
{
window: {
start: 2026-02-01T00:00:00+08:00,
end: 2026-02-01T06:00:00+08:00,
intervalHours: 6
},
counts: {
forYouFetched: 100,
followingFetched: 60,
afterIncremental: 34,
afterDedup: 26,
final: 20
},
digestText: 中文摘要内容,
items: [
{
id: 123456,
author: @handle,
createdAt: 2026-02-01T02:15:00+08:00,
text: 推文文本,
url: https://x.com/handle/status/123456,
sources: [following]
}
]
}