X.com Tweet Extraction
name: x-extract
by chunhualiao · published 2026-03-22
$ claw add gh:chunhualiao/chunhualiao-x-extract---
name: x-extract
description: Extract tweet content from x.com URLs without credentials using browser automation. Use when user asks to "extract tweet", "download x.com link", "get tweet content", or provides x.com/twitter.com URLs for content extraction. Works without Twitter API credentials.
---
# X.com Tweet Extraction
Extract tweet content (text, media, author, metadata) from x.com URLs without requiring Twitter/X credentials.
How It Works
Uses OpenClaw's browser tool to load the tweet page, then extracts content from the rendered HTML.
Workflow
1. Validate URL
Check that the URL is a valid x.com/twitter.com tweet:
2. Open in Browser
browser action=open profile=openclaw targetUrl=<x.com-url>Wait for page load (targetId returned).
3. Capture Snapshot
browser action=snapshot targetId=<TARGET_ID> snapshotFormat=aria4. Extract Content
From the snapshot, extract:
**Required fields:**
**Optional fields:**
5. Format Output
Output as structured markdown:
# Tweet by @username
**Author:** Full Name (@handle)
**Posted:** YYYY-MM-DD HH:MM
**Source:** <original-url>
---
<Tweet text content here>
---
**Media:**
- 
- 
**Engagement:**
- 👍 Likes: 1,234
- 🔄 Retweets: 567
- 💬 Replies: 89
**Thread:** [Part 2/5] | [View full thread](<thread-url>)6. Download Media (Optional)
If user requests `--download-media` or "download images":
1. Extract all media URLs from snapshot
2. Use `exec` with `curl` or `wget` to download:
```bash
curl -L -o "tweet-{tweetId}-image-{n}.jpg" "<media-url>"
```
3. Report downloaded files with paths
Error Handling
**If page fails to load:**
**If content extraction fails:**
Common Selectors
See [references/selectors.md](references/selectors.md) for detailed CSS/ARIA selectors used by x.com (updated as layout changes).
Limitations
Examples
**Extract single tweet:**
User: "Extract this tweet: https://x.com/vista8/status/2019651804062241077"
Agent: [Opens browser, captures snapshot, formats markdown output]**Extract with media download:**
User: "Get the tweet text and download all images from https://x.com/user/status/123"
Agent: [Extracts content, downloads images to ./downloads/, reports paths]**Thread extraction:**
User: "Extract this thread: https://x.com/user/status/456"
Agent: [Detects thread, extracts all tweets in sequence, formats as numbered list]More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...