Agent Skillsleamsigc/ShortsGenerator › twitter-research-scrape

twitter-research-scrape

GitHub

通过Chrome DevTools协议抓取X/Twitter特定话题的帖子,提取互动指标并去重排序,无需API密钥。

skills/twitter-research-scrape/SKILL.md leamsigc/ShortsGenerator

Trigger Scenarios

需要收集Twitter/X话题相关帖子数据 缺乏官方API访问权限需手动爬取

Install

npx skills add leamsigc/ShortsGenerator --skill twitter-research-scrape -g -y
More Options

Use without installing

npx skills use leamsigc/ShortsGenerator@twitter-research-scrape

指定 Agent (Claude Code)

npx skills add leamsigc/ShortsGenerator --skill twitter-research-scrape -a claude-code -g -y

安装 repo 全部 skill

npx skills add leamsigc/ShortsGenerator --all -g -y

预览 repo 内 skill

npx skills add leamsigc/ShortsGenerator --list

SKILL.md

Frontmatter
{
    "name": "twitter-research-scrape",
    "version": "3.0.0",
    "description": "Scrape state — runs the Twitter\/X topic scraper via Chrome DevTools\nProtocol. Searches X by topic, collects 10+ posts across many accounts,\nextracts engagement metrics (likes, retweets, replies, views), ranks them.\nOptionally augments with seed account profiles. No API key needed.\n",
    "allowed-tools": [
        "Bash",
        "Read",
        "Write",
        "ChromeDevTools"
    ]
}

Twitter/X Research — Scrape State (v3)

Scrapes topic posts from X/Twitter. Requires Chrome running with --remote-debugging-port=9222 and user logged into X.

Before running

Ensure:

  1. Chrome is open with --remote-debugging-port=9222 flag
  2. X/Twitter is logged in (tab stays open)
  3. Config exists at .twitter-research/<timestamp>/config.json (from setup)

Run

node "$CLAUDE_SKILL_ROOT/scripts/scrape.js" <timestamp> [--data-root <path>]
# fallback: node ./skills/twitter-research/scripts/scrape.js <timestamp>

Important: Keep the X tab in the foreground (visible, not minimized) while this runs. Chrome throttles background tabs.

What the script does

  1. Searches X by topic (Top tab, then Latest if needed) using config.topic + config.topicKeywords
  2. Scrolls to load many posts from different accounts
  3. Extracts per post: handle, author, text, timestamp, URL, likes/retweets/replies, media
  4. Visits seed accounts (config.accounts with isSeed: true) and keeps only topic-relevant tweets
  5. Deduplicates by URL, ranks by engagement, keeps top minPosts (min 10)
  6. Saves raw-posts.json with posts[], distinctAccounts, accountsSummary

Manual fallback (Chrome DevTools CLI)

If the script hits an X login wall or returns too few results, do it manually:

  1. Navigate: chrome-devtools navigate_page --url "https://x.com/search?q=<topic>&src=typed_query&f=top"
  2. Scroll: chrome-devtools evaluate_script --function "async () => { for (let i=0;i<12;i++){ window.scrollTo(0, document.body.scrollHeight); await new Promise(r=>setTimeout(r,1800)); } return 'ok'; }"
  3. Extract tweets using [data-testid="tweet"] selectors (tweetText, User-Name, reply/retweet/like aria-labels)
  4. Merge results into raw-posts.json with the same schema

Output

.twitter-research/<timestamp>/
├── raw-posts.json        # Ranked posts with engagement metrics
└── screenshots/          # Optional screenshots

Version History

  • 7b83166 Current 2026-08-29 02:31

Same Skill Collection

skills/facebook-research-analyze/SKILL.md
skills/facebook-research-engage/SKILL.md
skills/facebook-research-report/SKILL.md
skills/facebook-research-scrape/SKILL.md
skills/facebook-research-setup/SKILL.md
skills/facebook-research/facebook-research-template/SKILL.md
skills/ig-research-analyze/SKILL.md
skills/ig-research-report/SKILL.md
skills/ig-research-scrape/SKILL.md
skills/ig-research-setup/SKILL.md
skills/ig-research-transcribe/SKILL.md
skills/ig-research/SKILL.md
skills/list-workflows/SKILL.md
skills/new-workflow/SKILL.md
skills/onboard/SKILL.md
skills/reddit-research-generate/SKILL.md
skills/reddit-research-scrape/SKILL.md
skills/reddit-research/SKILL.md
skills/short-generator/SKILL.md
skills/twitter-research-analyze/SKILL.md
skills/twitter-research-report/SKILL.md
skills/twitter-research-setup/SKILL.md
skills/twitter-research-topics/SKILL.md
skills/workflow-conventions/SKILL.md
skills/facebook-research-grow/SKILL.md
skills/facebook-research/SKILL.md
skills/twitter-research/SKILL.md

Metadata

Files
0
Version
7b83166
Hash
99e32994
Indexed
2026-08-29 02:31

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-30 06:29
浙ICP备14020137号-1 $Carte des visiteurs$