Daily X Global Trending pipeline for AI music and AI video growth operations.
- Open X Global Trending with Playwright.
- Reuse
X_STORAGE_STATE_B64or injectX_COOKIESfor the X login session. - Open or click each configured category.
- Scroll the category feed to collect tweet candidates.
- Keep tweets from the configured lookback window.
- Merge source categories into 6 operating groups.
- Keep the hottest tweets in each group.
- Use an OpenAI-compatible LLM to write Chinese summaries and traffic actions for AI music/video acquisition.
- Send the report to Feishu and save a JSON copy.
Each tweet candidate includes:
authorcreated_atcontentrepliesretweetslikesviewsmedia_urlstweet_url
The processor also adds country, source_category, trending_term, and score.
X 趋势日报 | AI 视频 & AI 音乐 2026-06-10T08:30:00+08:00
一、AI / Tech / Creator Tools
1. AI 音乐(工具热议):创作者在讨论新工作流,适合拆成产品演示、教程短视频或生成模板。(1.2K赞 + 34转 + 56K浏览;https://x.com/...)
二、Music / Dance / Entertainment
暂无符合条件的推文。
七、最值得跟进的 5 个引流动作
1. AI 音乐工作流:发起“30 秒生成同款 BGM + 口播视频”挑战,提供 3 个模板,评论区关键词领取并跳转生成页。(34转 + 56K浏览;https://x.com/...)
When a metric is not collected from X, it is omitted instead of displayed as 0赞.
AI / Tech / Creator Tools
Technology, Science, Business & Finance, cryptocurrency
Music / Dance / Entertainment
music, dance, celebrity, Movies & TV, anime
Viral Culture / Meme / Social Buzz
meme, relationship, fashion, beauty, food, Pets
Gaming / Sports / Youth Culture
Gaming, Sports, cars
Lifestyle / Outdoor / Travel
Travel, Nature & Outdoors, Health & Fitness, Home & Garden
News / Society / Sensitive Topics
News, religion
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python -m playwright install chromium
copy .env.example .envFill .env locally:
X_COUNTRIES=Global
X_EXPLORE_URL=https://x.com/i/jf/global-trending/home
X_COOKIES=auth_token=...; ct0=...; guest_id=...
X_STORAGE_STATE_B64=
LLM_ENABLED=true
LLM_REQUIRED=true
LLM_API_KEY=...
LLM_BASE_URL=https://your-openai-compatible-endpoint
LLM_MODEL=...
LLM_REQUEST_TIMEOUT=300
OUTPUT_FORMAT=preview
DRY_RUN=truePreview without sending Feishu:
python main.py --output-format preview --dry-runPreview from the latest local JSON without scraping X again:
python main.py --input-json latest --output-format preview --dry-runSend the latest local JSON to Feishu without scraping X again:
python main.py --input-json latest --output-format feishuCheck category clicking:
python scripts\check_x_categories.py --headed --use-chromeIf GitHub Actions is redirected to X login even after setting X_COOKIES, export a full Playwright login state locally:
python scripts\export_x_storage_state.py --persistentAfter the browser opens, log in to X and press Enter in the terminal. Then copy the full content of outputs/x_storage_state.b64.txt into the GitHub Secret X_STORAGE_STATE_B64.
The workflow is in .github/workflows/daily-trending.yml.
It runs every day at 01:00 UTC, which is 09:00 Asia/Shanghai, and can also be started manually.
Required repository secrets:
X_STORAGE_STATE_B64orX_COOKIESLLM_API_KEYLLM_BASE_URLLLM_MODELFEISHU_WEBHOOK_URL
Optional repository secrets:
FEISHU_SECRET
Do not put API keys, X cookies, or Feishu webhook URLs in source files, README, .env.example, or normal GitHub variables.
GitHub Actions runs on a fresh Linux runner each time. The workflow installs Python dependencies and Playwright Chromium with system dependencies.
X cookies can expire or be invalidated after logout/password changes. If Actions starts redirecting to login, update X_STORAGE_STATE_B64 or X_COOKIES.