Loading...
Loading...
Scrape AI-related posts from X platform's "For You" feed, generate daily digest with reply suggestions. Features real-time scraping, AI topic filtering, share card generation, multi-language output (ZH/EN/JA).
npx skill4agent add deletexiumu/agentskills-hub x-ai-digestcd skills/dev-browser && npm run start-extension| 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 | Save location for the digest | Current working directory |
| Generate Replies | Whether to generate reply suggestions for selected posts | Yes |
// Connect to logged-in browser using dev-browser
const client = await connect();
const page = await client.page("x-home", { viewport: { width: 1920, height: 1080 } });
// Access X homepage
await page.goto("https://x.com/home");
await waitForPageLoad(page);
// Switch to "For You" tab
await page.click('text=For You');
await page.waitForTimeout(3000);tweetIdtweetUrlhttps://x.com/{username}/status/{tweet_id}datetimeusernamedisplayNamecontentreferences/scraping-guide.md// UTC time range corresponding to Beijing Time YYYY-MM-DD
// Beijing Time 00:00:00 = UTC 16:00:00 of the previous day
// Beijing Time 23:59:59 = UTC 15:59:59 of the same day
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`);tweetIdreferences/ai-keywords.mdassets/digest-template.mdassets/share-card-template.html.cardimport { 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);
// Capture only the .card element, exclude background
const card = await page.$('.card');
await card.screenshot({
path: `${outputDir}/ai-digest-${date}.png`,
type: "png"
});
await browser.close();{output_dir}/
├── x-posts-{date}.json # Raw data
├── x-posts-{date}.md # Post list table
├── AI-Digest-{date}.md # Complete digest
└── ai-digest-{date}.png # WeChat official account share image# Daily AI Digest | {date}
## 1. Today's Hot Topics
### 🔥 Topic 1
### 🆕 Topic 2
...
## 2. Selected Posts and Reply Suggestions
### 1. Author - Topic
**Original**: ...
**Link**: ...
**Suggested Reply (Language)**: ...
**Chinese Explanation**: ... (if non-Chinese)
## 3. Quote of the Day
...
## 4. Accounts Worth Following
...references/scraping-guide.mdreferences/ai-keywords.mdassets/digest-template.mdassets/share-card-template.htmlreferences/share-card-guide.md