SuperAPI AI Directory

x-subscribe

Frontend & websites

View repository

Updated 10-16 05:05

About this skill

X (Twitter) Subscribed Account Tweets

1. Introduction

Subscribe to famous X (Twitter) accounts,automatically fetch tweets posted by subscribed accounts from yesterday 9:00 to today 9:00 (the last 24 hours) every morning at 9:00, and generate a beautifully designed HTML daily report grouped by account, with no need to manually scroll through each feed. Subscription sources support three entry points: leaderboard recommendations, user-specified accounts, and following list exploration.

Leaderboard Recommendationsis the built-in batch subscription source of this Skill: a fixed query ofyesterday'sX trending account leaderboard, supporting gender (all/male/female) and 32 industry category filters. Users can subscribe to the Top N accounts on the leaderboard with one click and then enter daily tweet tracking.

Target Users: overseas brands / advertisers (evaluating KOL collaboration windows), MCNs / business agencies (tracking the activity of dozens of celebrity accounts in bulk), content creators / researchers (tracking the posting rhythm and viral hits of top accounts).


2. Features

Feature Module Capability Description
Three-Entry Subscription Batch subscription from leaderboard / subscription by specified @handle / subscription after following list exploration
Daily Automatic Push The automation task has built-in account handles and automatically fetches yesterday's tweets every day at 9:00
Time Window Filtering The API does not support sorting by time; the Skill internally filters by the "yesterday 9:00 ~ today 9:00" time window and intelligently paginates with cursors
HTML Daily Report X platform style (white background + X blue), displays tweet timelines grouped by account, supports export to PDF / high-resolution images
Engagement Data Views / likes / reposts / replies / posting time, repost and quote markers
AI Semantic Summary AI reads tweet content and summarizes the "today's theme" (analyzing what the tweets are saying, based on the actual number of tweets) + each account's "today's theme/opinions"
No-Update Collapsing Accounts with no updates yesterday / no updates in the last 7 days are automatically collapsed with a notice

3. Authentication

Get API Key

Please go to Red Fox Hub to get the API KEY.

Configure API Key

Option 1: Taking OpenClaw as an example, add REDFOX_API_KEY to ~/.openclaw/openclaw.json:

{ "env": { "REDFOX_API_KEY": "ak_xxxx..." } }

Option 2: Terminal configuration:

export REDFOX_API_KEY="ak_xxxx..."

Dependencies

No third-party dependencies need to be installed; it runs using the Python standard library.


4. Subscription Methods (Three Entry Points)

Silent Execution Principle: All intermediate steps (fetch verification, leaderboard query, automation_update) must not output process prompts to the user; only the final result is shown.

When the user expresses an intention to subscribe but the method is unclear, first output guidance:

📬 订阅 Twitter 名人作品日报,三种方式任选:
1️⃣ 榜单订阅 — 说「订阅XX分类热门榜单 Top 10/20/50」
2️⃣ 指定账号 — 直接发我 @handle 或账号链接,如「订阅 @elonmusk」
3️⃣ 关注探索 — 不知道订阅谁?从 TA 的关注列表里挑,说「看看elonmusk关注了谁」
已订阅后每天 9:00 自动推送昨日发帖日报,最多可订阅 100 个账号。

Entry Point 1: Batch Subscription from the Trending Account Leaderboard (Recommended Main Path)

  1. The user views a category leaderboard (such as the "Business & Entrepreneurship Daily Leaderboard"), or directly says "subscribe to the top 30 on the tech leaderboard"

  2. The Agent runs the top subcommand to queryYesterdayRanking (parse N, N ≤ 100):

    python3 scripts/subscribe.py top --query "用户原始问题" --top 20
    
  3. Extract each account from the end of the output screen_name(the script has already extracted from profileUrl of x.com/<handle> , and outputs a comma-separated list)

  4. Run fetch --first to verify whether each account can be successfully fetched:

    python3 scripts/subscribe.py fetch --accounts "handle1,handle2,..." --first --html
    
  5. Batch-write the verified accounts into the daily 9:00 automation task (see "Account Management Rules"), and tell the user the result

  6. Execute once immediately to show the result (first fetch of each account's latest updates)

The end of the ranking output should provide a subscription prompt: whether to subscribe to the ranking's Top 10/20/50, or if none are satisfactory, you can directly subscribe to all.

Entry 2: Subscribe by entering an account individually

The user provides @handle or an account link → extract screen_name → execute verification immediately → append to the subscription list:

# 验证并首次展示(静默执行)
python3 scripts/subscribe.py fetch --accounts "elonmusk" --first --html

After verification passes, append to the automation task's --accounts parameter (see "Account Management Rules").

Entry 3: Following list exploration

When the user does not know whom to subscribe to (e.g., "see who Musk is following") → call following to fetch the following list (by default only 1 page is fetched, and at most 20 are shown the first timeaccounts, including name/follower count/bio) → the user selects from them → go through Entry 2 to subscribe:

# 默认:拉 1 页,最多展示前 20 个
python3 scripts/subscribe.py following --account "elonmusk"
# 用户想「查看更多」:展示本页已获取的全部账号(不发起新请求)
python3 scripts/subscribe.py following --account "elonmusk" --all
# 用户想「继续翻页」:用上次输出的 nextCursor 拉下一页
python3 scripts/subscribe.py following --account "elonmusk" --cursor "<nextCursor>"

Display strategy: show only the first 20 the first time; when there are still undisclosed accounts on this page, prompt "view more" (add --all to show all), and when moreUsers=true , prompt "continue paging" (add --cursor)。


5. Fetching works API handling (core rules)

The APIdoes not support sorting by time, and the timeline is returned in reverse order. The Skill handles it differently by scenario:

First subscription view (--first)

Directly fetch page 1 of tweets, showing 20 per account by default,without filtering by time window。

Subsequent daily updates of subscribed works (default mode)

Time window: when running daily at 9:00 AM, fetch tweets within the nearly 24-hour window from "yesterday 9:00 to today 9:00" (the API does not support sorting by time, so they must be compared one by one).

  1. Fetch page 1 of tweets
  2. Check each tweet's posting time one by one (createdAt is UTC, convert tolocal time zone), and keep only tweets that fall within the window "yesterday 9:00 to today 9:00"
  3. If this page contains matching tweetsandthere are no tweets earlier than the window start (yesterday 9:00) → continue paging with cursor
  4. When the page already contains tweets earlier than the window start → stop paging, and keep only the tweets within the window
  5. Safety limit: at most 5 pages per account (--max-pages adjustable), or stop when nextCursor is empty

cursor is a server-side state identifier and cannot be constructed on your own; you must strictly use the nextCursor。

Account status determination

Status Determination condition Report handling
updated Contains yesterday's tweets Display the tweet table normally
no_update_yesterday No tweets from yesterday, but there are tweets in the past 7 days Collapse and prompt "No updates yesterday"
no_update_7d Latest tweet earlier than 7 days ago / no tweets Collapsed prompt "No updates in the last 7 days"
error API request failed Collapsed prompt failure reason

6. Usage Guide

Command Quick Reference

User Intent Command
Fetch yesterday's tweets from subscribed accounts (daily update) fetch --accounts "h1,h2" --html
First-time subscription verification / view latest updates fetch --accounts "h1,h2" --first --html
Specify a historical date fetch --accounts "h1" --date 2026-09-20 --html
Explore a certain account's following list (default 1 page / max 20) following --account "elonmusk"
Query yesterday's ranking recommendations (source for batch subscriptions) top --query "科技软件榜前20" --top 20

fetch parameters

Parameter Description
--accounts Required,, account list, comma-separated (@handle or x.com links both work)
--date Time window end date YYYY-MM-DD(default: 24 hours before the most recent 9:00 boundary)
--first First-time subscription mode: fetch all tweets from the first page, no filtering by date
--max-pages Maximum pages per account in daily update mode (default 5)
--markdown Output a Markdown table (for Agent relay)
--html Generate an HTML daily report (browser opens automatically)
--output Custom JSON output path

following / top parameters

  • following:--account(required),--pages(default 1),--limit(max items to display on first run, default 20),--all(display all fetched),--cursor(pagination cursor)
  • top:--query(auto-parse industry/gender),--category、--gender、--top(default 20, max 100),--date(default yesterday)

Global parameter --api-key must be placed before the subcommandbefore(e.g. subscribe.py --api-key ak_xxx fetch ...), defaults to reading the environment variable REDFOX_API_KEY。

Account name correction (Agent must comply)

If fetching a certain account fails (status=error), please prompt the user to confirm whether the account name is correct—the handle can be obtained from the X profile link, e.g. https://twitter.com/elonmusk in elonmusk、https://x.com/naval in naval. The script will also print this prompt on failure.


7. Account Management Rules (Agent must comply)

Core principle: all subscription status = the --accounts parameter in automation commands. No local file storage.

Upper limit

  • A single automation task supports at most 50 accounts
  • Total subscription limit 100 accounts

New account subscription process

  1. Query existing automation tasks: Use automation_update mode=list to get all "X subscription"-related tasks, and read the account list in each task's --accounts list of accounts in

  2. Determine append / create new:

    Condition Action
    Existing account count + new account count ≤ 50 Append to the existing task's --accounts(comma-joined after deduplication)
    Existing account count + new account count > 50 and total ≤ 100 Create a new automation task, put the overflow into the new task
    Total will be > 100 Inform the user that the limit has been reached; please unsubscribe some accounts before subscribing
    The user requests to unsubscribe a certain account Remove this handle from the corresponding task --accounts Remove this handle
  3. Update/create automation task:

    • Append:automation_update mode=update Modify the existing task prompt in --accounts
    • Create new:automation_update mode=create, runs daily at 9:00 (FREQ=DAILY;BYHOUR=9;BYMINUTE=0), add a sequence number to the name, e.g. "X Subscription Tweet Daily Report #2"
    • automation prompt example:拉取X(Twitter)订阅账号昨日推文并生成HTML日报推送给用户:python3 scripts/subscribe.py fetch --accounts "h1,h2,..." --html
  4. Fetch once immediately: Whether appending or creating new, it must be executed once immediately fetch --first --html to show the latest results

Unsubscribe

From the corresponding task's --accounts remove this handle. If a task has 0 accounts remaining after removal, delete that automation task.


8. Output format

Subscription result overview (must be output when subscribing/fetching)

📊 订阅结果
| 项目 | 值 |
|------|-----|
| 本次订阅 | 20 个(科技软件榜 Top 20,2 个已订阅跳过) |
| 当前总订阅 | 45 / 100 个 |
| 自动化任务 | 已更新 ✅ 每日 9:00 自动执行 |
| 首次拉取 | 以下展示各账号最新动态 |

Per-account tweet detail table (Markdown)

▸ Elon Musk(粉丝: 2.4亿)

| 推文摘要 | 浏览 | 点赞 | 转发 | 回复 | 发布时间 |
|---------|------|------|------|------|---------|
| Starship Flight 12 launch tomorrow... | 8,900w | 120w | 21w | 3.4w | 09-19 08:30 |

Requirements:

  • One subheading + one complete Markdown table per account; each account shows 20 items by default
  • Tweet summaries use text original text (truncate to the first 60 characters if too long), rendered as a clickable hyperlink [摘要](tweetUrl)
  • Add a 🔁 prefix to retweets and a 💬 prefix to quoted tweets
  • Numeric columns use readable format (8,900w / 120w / 3.4w)
  • Truncate the publish time to MM-DD HH:mm(local timezone)
  • Collapsed notice for accounts with no updates yesterday / no updates in the past 7 days, e.g.: "The following 12 accounts have no updates in the past 7 days and have been collapsed"

Summary statistics (must be appended after all tables)

By AI reads tweet contentto generate a semantic summary, without connecting to an LLM endpoint or doing word-frequency statistics. Written to the same directory as the data file x_subscribe_ai_summary.json,generate_report.py automatically merged into the HTML when rendering.

{
  "overall": [
    {"title": "主题/事件名", "summary": "这段在讲什么(1-2 句)", "accounts": ["elonmusk"], "tweetCount": 11}
  ],
  "accounts": [
    {"screenName": "elonmusk", "theme": "该账号今日主要聊了什么主题", "viewpoint": "该账号表达的观点/立场"}
  ]
}

Requirements:

  • overall is "Today's Theme Summary": analyze what the tweets are actually talking about (events/themes),not simply high-frequency words; summarize as many as there are, do not force exactly 5 items, and do not fabricate
  • accounts is a single-account summary: one item for each account with updates, explaining the "main theme" and "viewpoint/stance"
  • The number of themes should be based on actual content; if there are fewer than 5, write fewer; do not force it

Output completeness checklist

For each subscription/fetch, the conversation must include:

  • Subscription result overview table
  • Markdown tweet detail table for each account with updates
  • Collapsed notice for accounts without updates (if any)
  • Summary statistics analysis (AI semantic summary: today's themes + per-account themes/viewpoints)
  • Only when there is tweet data: HTML daily report generated notice (with file path) + automatically open preview
  • The HTML daily report's "Report Notes" will explain the difference between 🔁 retweets and 💬 quotes, and explain why likes/replies for pure retweets are often empty or 0 (a retweet is not an independent tweet; interaction data belongs to the original tweet)

9. Project architecture

x-subscribe/
├── SKILL.md                          # 本文件
├── scripts/
│   ├── subscribe.py                  # 统一入口:fetch / following / top 子命令
│   └── generate_report.py            # 生成 X 风格 HTML 日报(导出 PDF/图片)
├── assets/
│   └── category_config.json          # 榜单更新规则 + 性别/行业枚举与关键词映射
├── output/                           # JSON 数据与 HTML 日报输出目录(运行时自动创建)
└── references/
    └── api_docs.md                   # 3 个接口详细文档(技术参考)

Core module description

  • subscribe.py:
    • fetch — Fetch subscribed accounts' tweets, supporting first-time mode (fetch the first page) and daily mode (filter by yesterday + smart cursor paging), output JSON + Markdown,--html calls report generation
    • following — Fetch the account follow list, cursor paging, used for exploration before subscribing
    • top — Query yesterday's trending accounts leaderboard (built-in leaderboard data source), parse screen_name from profileUrl, and output a handle list that can be used directly for fetch --accounts list of handles
  • generate_report.py: Read the JSON output by fetch to generate an X platform-style (pure white background + X blue) HTML daily report, displaying tweet timelines grouped by account (including avatars, verification badges, cover images, and engagement data), with accounts that have no updates collapsed, and built-in one-click download PDF / high-resolution image buttons (html2canvas + jsPDF directly generate file downloads, not browser printing); automatically open the browser after generation. File name format X订阅日报_{日期}.html(first-time mode is X订阅首次拉取_{日期}.html)。

Resource Index

File Purpose
scripts/subscribe.py Fetch tweets / following list / leaderboard recommendations
scripts/generate_report.py Generate HTML visual daily report
references/api_docs.md Detailed documentation for 3 APIs (technical reference)

10. FAQ

Q: What dependencies need to be installed? A: No third-party dependencies are required; it runs with the Python standard library.

Q: What is the maximum number of accounts that can be subscribed to? A: The total limit is 100; a single automation task can have at most 50, and any excess automatically creates a new task.

Q: When is the daily report pushed? What time period of data is fetched? A: It runs automatically every day at 9:00 AM, fetching tweets published within the nearly 24-hour window from "yesterday 9:00 to today 9:00" (local time zone).

Q: The API does not support sorting by time, so how do you ensure only tweets within the time window are fetched? A: The Skill internally pages through using cursor and compares publication times one by one: if it hits the window and there are no tweets earlier than the window start (yesterday 9:00), it continues paging; once an earlier tweet appears, it stops, keeping only tweets within the window (see Section 5 for details).

Q: What time zone are tweet times in? A: The API returns UTC time, and the Skill uniformly converts it tolocal time zonefor display and filtering.

Q: What if an account did not tweet yesterday? A: The report collapses it with the note "No updates yesterday"; if there have been no updates in the past 7 days, it shows "No updates in the past 7 days".

Q: How do I unsubscribe? A: Tell the Agent the account to unsubscribe, and the Agent removes the handle from the corresponding automation task's --accounts .

Q: What is the data date for leaderboard recommendations? A: top The subcommand always queries yesterday's leaderboard (updated daily at 9:00 with the previous day's data, with a maximum lookback of 7 days).