twitter-monitor

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Twitter Monitor

Twitter 监控工具

Workflow

工作流程

Use this skill as an execution workflow, not as a long-running daemon. First complete a one-shot fetch, then offer optional Feishu sync and scheduling only when useful.
  1. Ask for X/Twitter account ids when missing. Accept handles such as
    sama
    ,
    @sama
    , profile URLs, or multiple comma-separated ids.
  2. Ask the user to provide or configure a
    twitterapi.io
    API key when
    TWITTER_API_KEY
    is unavailable. Do not write API keys into files committed to a repository.
  3. Confirm pagination depth. Default to
    --pages 1
    ; use a larger number only when the user asks for more history or accepts higher API usage.
  4. Run
    scripts/twitter_monitor.py
    and generate JSON or CSV output.
  5. If the user wants Feishu/Lark Bitable output, follow
    references/feishu-output.md
    .
  6. After the one-shot command works, ask whether they want recurring execution. If yes, follow
    references/scheduling.md
    , including OpenClaw when appropriate.
请将该技能作为执行工作流使用,而非长期运行的守护进程。先完成一次性数据抓取,仅在有需要时再提供可选的飞书同步和定时调度功能。
  1. 若缺少X/Twitter账号ID,请向用户询问。支持用户名(如
    sama
    @sama
    )、个人主页链接,或以逗号分隔的多个账号ID。
  2. TWITTER_API_KEY
    不可用时,请让用户提供或配置
    twitterapi.io
    API密钥。请勿将API密钥写入提交到代码仓库的文件中。
  3. 确认分页深度。默认值为
    --pages 1
    ;仅当用户需要更多历史数据或同意更高API调用量时,才使用更大的数值。
  4. 运行
    scripts/twitter_monitor.py
    并生成JSON或CSV格式的输出。
  5. 若用户需要将输出保存至飞书/Lark多维表格,请遵循
    references/feishu-output.md
    中的指引。
  6. 一次性命令执行成功后,询问用户是否需要定期执行。若需要,请遵循
    references/scheduling.md
    中的指引,适当时可使用OpenClaw。

Quick Start

快速开始

From this skill directory:
bash
export TWITTER_API_KEY="..."
python scripts/twitter_monitor.py --accounts sama --pages 1 --format json
For multiple accounts:
bash
python scripts/twitter_monitor.py --accounts sama,elonmusk,OpenAI --pages 1 --format csv
For a JSON account list:
bash
python scripts/twitter_monitor.py --accounts-file assets/accounts.example.json --pages 1
Read
references/twitterapi-setup.md
when the user needs API key setup, account input examples, or command variants.
在该技能目录下执行以下命令:
bash
export TWITTER_API_KEY="..."
python scripts/twitter_monitor.py --accounts sama --pages 1 --format json
针对多个账号的情况:
bash
python scripts/twitter_monitor.py --accounts sama,elonmusk,OpenAI --pages 1 --format csv
针对JSON格式的账号列表:
bash
python scripts/twitter_monitor.py --accounts-file assets/accounts.example.json --pages 1
若用户需要API密钥配置、账号输入示例或命令变体说明,请查阅
references/twitterapi-setup.md

Output Schema

输出 Schema

The script writes one record per tweet with these fields:
  • 推文内容
  • 日期
  • 推文链接
  • 推文ID
  • 作者
  • 作者ID
  • 阅读量
  • 点赞数
  • 转发数
  • 评论数
  • 收藏数
  • 是否回复
  • 抓取时间
Deduplicate by
推文ID
before appending to any durable destination.
脚本会为每条推文生成一条记录,包含以下字段:
  • 推文内容
  • 日期
  • 推文链接
  • 推文ID
  • 作者
  • 作者ID
  • 阅读量
  • 点赞数
  • 转发数
  • 评论数
  • 收藏数
  • 是否回复
  • 抓取时间
在将记录追加至任何持久化存储前,请通过
推文ID
进行去重。

Feishu

飞书

Do not require Feishu configuration for normal fetches. Only enter the Feishu workflow when the user asks to write, append, or sync records to Feishu/Lark Bitable.
Prefer
feishu-cli
over hard-coded Feishu app credentials. If
feishu-cli
is missing, ask whether to install and configure it. See
references/feishu-output.md
for the field mapping and sync rules.
常规数据抓取无需要求用户配置飞书。仅当用户明确要求将记录写入、追加或同步至飞书/Lark多维表格时,才进入飞书工作流。
优先使用
feishu-cli
而非硬编码的飞书应用凭证。若未安装
feishu-cli
,请询问用户是否需要安装并配置。字段映射和同步规则请查阅
references/feishu-output.md

Scheduling

定时调度

Offer scheduling only after a successful one-shot fetch or when the user explicitly asks for ongoing monitoring.
Prefer OpenClaw when the user wants an agent-managed recurring job or already uses OpenClaw. Otherwise choose Codex automations, cron, or launchd based on the runtime environment. See
references/scheduling.md
.
仅在一次性抓取成功后,或用户明确要求持续监控时,才提供定时调度选项。
若用户需要由Agent管理的定期任务,或已在使用OpenClaw,则优先选择OpenClaw。否则根据运行环境选择Codex自动化工具、cron或launchd。详细说明请查阅
references/scheduling.md

Safety

安全注意事项

Never commit real API keys, Feishu tokens, output files containing private monitoring data, or local status caches. Keep secrets in environment variables, secret managers, or the user's existing CLI auth.
请勿提交真实的API密钥、飞书令牌、包含隐私监控数据的输出文件或本地状态缓存。请将机密信息存储在环境变量、密钥管理器或用户已有的CLI认证中。