Invoke / Invoke / Invocation
中文
- "Use x-ai-digest to fetch today's AI hot topics"
- "Use x-ai-digest to generate yesterday's X platform AI briefing"
- "x-ai-digest help me check what AI-related activity there was on X the day before yesterday"
- "Use x-ai-digest to organize recent AI tweets and provide reply suggestions"
English
- "Use x-ai-digest to scrape today's AI hot topics from X"
- "Use x-ai-digest to summarize AI posts from yesterday in English"
- "Generate an X platform AI digest for 2026-01-20 using x-ai-digest"
- "Use x-ai-digest to compile recent AI tweets with reply suggestions"
日本語
- "Use x-ai-digest to summarize today's AI-related posts in Japanese"
- "Use x-ai-digest to fetch yesterday's AI trends on the X platform"
- "Use x-ai-digest to compile recent AI-related tweets"
- "Use x-ai-digest to collect AI posts from the day before yesterday and create reply suggestions"
Scrape AI-related information for a specified date from the "For You" tab on the X platform homepage, and generate a structured daily briefing:
- Deliverables: 1 Markdown briefing + 1 JSON raw data file + 1 WeChat official account share image
- Each post: time, author, content, original link
- Briefing content: hot topic summary, product launches, selected posts, reply suggestions
- Share image: card-style design, including today's hot topic summary, suitable for sharing on WeChat official accounts/Moments
- Default output:中文(English/Japanese content needs translation)
-
dev-browser skill installed and running
- Need to use browser extension mode to connect to a browser already logged into X
- Startup command:
cd skills/dev-browser && npm run start-extension
-
X account logged in
- The user needs to log in to their X account in the Chrome browser
- Ensure access to the "For You" tab
| Parameter | Description | Default value |
|---|---|---|
| Date | Which day's data to scrape | Today (YYYY-MM-DD) |
| Quantity range | Target number of posts | 50-100 posts |
| Output directory | Briefing save location | Current working directory |
| Whether to generate replies | Whether to generate reply suggestions for selected posts | Yes |
Step 1: Connect to the browser and visit the X homepage
// 使用 dev-browser 连接已登录的浏览器
const client = await connect();
const page = await client.page("x-home", { viewport: { width: 1920, height: 1080 } });
// 访问 X 主页
await page.goto("https://x.com/home");
await waitForPageLoad(page);
// 切换到「为你推荐」标签
await page.click('text=为你推荐');
await page.waitForTimeout(3000);
Step 2: Scroll and scrape posts
Scroll the page in a loop and extract for each post:
tweetId- Post unique IDtweetUrl- Original link (https://x.com/{username}/status/{tweet_id})datetime- Publication time in ISO 8601 formatusername- UsernamedisplayName- Display namecontent- Post content
For detailed implementation, see references/scraping-guide.md
Step 3: Time filtering
Convert UTC time to Beijing time (UTC+8) for filtering:
// 北京时间 YYYY-MM-DD 对应的 UTC 时间范围
// 北京时间 00:00:00 = UTC 前一天 16:00:00
// 北京时间 23:59:59 = UTC 当天 15:59:59
const startUTC = new Date(`${date.slice(0, 4)}-${date.slice(5, 7)}-${parseInt(date.slice(8, 10)) - 1}T16:00:00.000Z`);
const endUTC = new Date(`${date}T15:59:59.999Z`);
Step 4: Deduplication and quantity control
- Use
tweetIdfor deduplication - Can stop when the cumulative total reaches 50 posts, with a maximum of 100 posts scraped
- If 50 posts are still not reached after multiple scrolls, use the actual quantity
- Stop when there is no new data after 10 consecutive scrolls
Step 5: Filter AI-related content
Use keyword matching to filter AI-related posts; see the keyword list in references/ai-keywords.md
Step 6: Generate the briefing
Use template assets/digest-template.md to generate the briefing, including:
- Today's hot topics
- Important product/feature releases
- Industry observations
- Selected posts and reply suggestions
- Accounts worth following
Reply suggestion rules:
- Generate replies in the original language of the post
- Non-Chinese posts must include a Chinese explanation
- Reply content must be valuable; avoid empty praise
Step 7: Generate the official account share image
Based on assets/share-card-template.html generate a share card:
- Generate an HTML file: populate the template based on today's hot topics
- Capture a screenshot to generate a PNG: use playwright to capture the
.cardelement
import { chromium } from "playwright";
const browser = await chromium.launch({ headless: true });
const page = await browser.newPage({ viewport: { width: 900, height: 1800 } });
await page.goto(`file://${htmlPath}`);
await page.waitForTimeout(2000);
// 只截取 .card 元素,不要背景
const card = await page.$('.card');
await card.screenshot({
path: `${outputDir}/ai-digest-${date}.png`,
type: "png"
});
await browser.close();
The card content includes:
- Title and date
- Summaries of 3-4 hot topics today
- Statistics (number of posts, number of topics, number of product releases)
- Data source attribution
- Only scrape publicly visible posts; do not attempt to bind login or bypass restrictions
- Scroll interval >= 1 second to avoid triggering anti-scraping mechanisms
- If a network error or page anomaly occurs, degrade to outputting the data already scraped
- Confirm the path before outputting files to avoid overwriting existing files
- Preserve original links when translating to ensure traceability
File structure
{output_dir}/
├── x-posts-{date}.json # 原始数据
├── x-posts-{date}.md # 帖子列表表格
├── AI简报-{date}.md # 完整简报
└── ai-digest-{date}.png # 公众号分享图片
Briefing structure
# AI 每日简报 | {date}
## 一、今日热点话题
### 🔥 话题1
### 🆕 话题2
...
## 二、精选帖子及回复建议
### 1. 作者 - 话题
**原文**:...
**链接**:...
**建议回复(语言)**:...
**中文说明**:...(如非中文)
## 三、今日金句
...
## 四、值得关注的账号
...
Resources
- Scraping implementation guide:
references/scraping-guide.md - AI keyword list:
references/ai-keywords.md - Briefing template:
assets/digest-template.md - Share card template:
assets/share-card-template.html - Share card generation guide:
references/share-card-guide.md