跳到正文
Skillpedia
社交媒体6.3k · #14320

x-tweet-by-url

它能做什么

这项技能接收一个 X 或 Twitter 链接,并返回该页面上显示的推文。适合已经有链接、想直接获取其中数据、又不想自己选择方法的人。

适用场景

  • ✓当你有一个 X 搜索链接,想把其中的推文整理成列表时。
  • ✓当你有一条推文的链接,想查看其详细信息时。
  • ✓当你有一个 X 列表链接,想查看其中显示的推文的时候。

技能链接

https://github.com/browser-act/skills/blob/main/solutions/social-listening/x-tweet-by-url/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/browser-act/skills/blob/main/solutions/social-listening/x-tweet-by-url/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“这是一个 X 搜索链接。请帮我整理它显示的推文,包括作者和互动数。”

每周 5 个新技能,1 分钟读完。

工作原理

这项技能会判断链接指向哪种 X 页面,在你已登录的浏览器中打开它,并读取加载出的推文。它返回每条推文的正文、作者、互动数、媒体、话题标签、提及,以及用于获取更多内容的游标。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

X — Tweets by URL

Any X URL (search, profile, single tweet, list) → normalized list of tweets matching that URL's timeline.

Language

All process output to user (progress updates, process notifications) follows the user's language.

Objective

Accept any X URL as input, automatically detect which timeline endpoint it triggers, navigate to it, and return structured per-tweet data with pagination cursors. This unifies search, profile, single-tweet conversation, and list extraction under one entry point.

Prerequisites

  • Active X session in the browser (left sidebar shows logged-in avatar / @handle).
  • Network capture is enabled in the browser-act session.

Pre-execution Checks

1. Tool Readiness

If browser-act has been confirmed available in the current session → skip this step.

Invoke browser-act via Skill tool to load usage. If installation or configuration issues arise, follow its guidance to resolve then retry.

2. Login Verification

If login status for X has been confirmed in the current session → skip this step.

Otherwise: open https://x.com and observe the left sidebar:

  • User avatar or @handle visible → logged in, continue
  • "Sign in" / "Log in" prompt visible → not logged in, inform the user and assist the login flow

User refuses or cannot log in → terminate execution.

Capability Components

This Skill's operational boundary = what the user can manually do in their browser. It only reads tweet data already shown to the user, never bypassing authentication. The browser's own JS signs the GraphQL request; the Skill triggers it via URL navigation and reads the response from network traffic. Python scripts under scripts/ only classify URLs and parse responses — they do not call X directly. Run them through the bash tool.

Network Capture: tweets via input URL

Step 1 — classify the URL to determine which GraphQL endpoint will be triggered and which --source to pass to the parser:

META=$(python scripts/classify-url.py '{url}')

classify-url.py outputs a JSON object with fields:

  • normalized_url: the URL with twitter.com rewritten to x.com.
  • kind: one of search, user_tweets, user_replies, user_media, tweet_detail, list, unknown.
  • endpoint: the GraphQL endpoint name to filter by (SearchTimeline / UserTweets / UserTweetsAndReplies / UserMedia / TweetDetail / ListLatestTweetsTimeline).
  • extract_source: the --source value to pass to parse-tweets.py (search / user_tweets / user_replies / user_media / tweet_detail / list).
  • params: detected path parameters (handle, tweet_id, list_id) when applicable.

If kind == "unknown", report to the user that the URL is not a supported X timeline type and stop.

Step 2 — navigate and capture the first page:

  1. network requests --clear
  2. navigate "$(echo "$META" | python -c "import sys,json;print(json.load(sys.stdin)['normalized_url'])")"
  3. wait stable --timeout 25000 (timeout is normal on X; proceed)
  4. Let EP = endpoint from $META. network requests --type xhr,fetch --filter "$EP" → take the latest entry's request_id.
  5. network request <request_id> → save to tmp/x-url-page-1.txt.
  6. Let SRC = extract_source from $META. python scripts/parse-tweets.py --json-file tmp/x-url-page-1.txt --source "$SRC".

Endpoint characteristic: URL contains /i/api/graphql/<hash>/<endpoint-name>. The query hash rotates; always filter by name.

Step 3 — paginate via scroll (skip when kind == "tweet_detail" and only the focal tweet is required; keep paginating when collecting the full reply thread):

  1. network requests --clear
  2. scroll down --amount 5000
  3. wait stable --timeout 10000
  4. network requests --type xhr,fetch --filter "$EP" → newest entry's request_id
  5. network request <request_id> → save to tmp/x-url-page-N.txt
  6. python scripts/parse-tweets.py --json-file tmp/x-url-page-N.txt --source "$SRC"

Repeat Step 3 until any termination condition is met:

  • Accumulated unique tweet count reaches the user's target.
  • count == 0 on the current page.
  • cursor_bottom is unchanged across two consecutive pages.

Error handling: if no matching request appears after a scroll, wait 3 s and retry once. If kind == "search" and the page shows a captcha challenge (detect via state showing an "Authorize access to your account" or "Help us keep X safe" panel), pause and ask the user. If kind == "list" and the response's `data.list.twe

常见问题

哪些链接可以使用?

描述中涵盖搜索页面、个人主页、单条推文和列表时间线。

我需要登录吗?

需要。这项技能需要你的浏览器中有一个有效的 X 会话。

我可以一次提供多个链接吗?

可以。描述中说明,它接受 X 和 Twitter 的混合链接。

详情

作者的原始描述

Scrapes tweets from any X (Twitter) URL — search results, user profile, single tweet detail, or list timeline — and returns normalized per-tweet data with text, author, engagement counts, media, hashtags, mentions, and cursor for pagination. Use when user mentions X URL scraper, Twitter URL scraper, scrape from URL, given an X link, given a Twitter link, accept mixed X URLs, accept mixed Twitter URLs, search URL, profile URL, list URL, status URL, tweet detail URL, scrape startUrls Twitter, X startUrls, mixed batch of Twitter links, paste links and scrape, mass URL extraction X, mass URL extra

repo: browser-act/skills

热度

GitHub 星标
6.3k
排名
#14320
许可证
MIT
更新时间
2026/8/24

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能