Install
openclaw skills install twitter-readerExtract complete data from X/Twitter tweets by URL, including text, author info, timestamps, engagement stats, media, quoted tweets, and thread context.
openclaw skills install twitter-readerA comprehensive skill for reading and extracting data from X (formerly Twitter) tweets using multiple reliable data sources.
This skill extracts complete tweet information including text content, author details, engagement statistics, media attachments, and quoted tweets from X/Twitter URLs. It uses a multi-tier approach for maximum reliability and data completeness.
Primary Triggers:
Example User Requests:
https://x.com/username/status/1234567890https://twitter.com/username/status/1234567890?s=20, ?t=abc123)# Read a single tweet
./scripts/read_tweet.sh "https://x.com/username/status/1234567890"
# Read a full thread (follows reply chain from the same author)
./scripts/read_thread.sh "https://x.com/username/status/1234567890"
# Fallback method using Nitter
./scripts/read_tweet_nitter.sh "https://x.com/username/status/1234567890"
When a user provides a tweet URL:
scripts/read_tweet.sh firstscripts/read_tweet_nitter.shThe scripts return structured JSON with this format:
{
"success": true,
"tweet": {
"text": "Tweet content here...",
"author": {
"name": "Display Name",
"handle": "username"
},
"timestamp": {
"formatted": "2024-01-15 14:30:25 UTC",
"original": "Mon Jan 15 14:30:25 +0000 2024"
},
"url": "https://x.com/username/status/1234567890",
"engagement": {
"likes": 1250,
"retweets": 340,
"replies": 89,
"quotes": 45
},
"media": {
"photos": ["https://pbs.twimg.com/media/..."],
"video": "https://video.twimg.com/..."
},
"quoted_tweet": {
"text": "Quoted tweet text...",
"author": {
"name": "Quoted Author",
"handle": "quoted_user"
},
"url": "https://x.com/quoted_user/status/987654321"
}
},
"source": "fxtwitter",
"fetched_at": 1705327825
}
**Tweet from @elonmusk:**
> "Just had a great meeting about sustainable transport. The future is electric! ⚡🚗"
**Posted:** January 15, 2024 at 2:30 PM UTC
**Engagement:** 1,250 likes • 340 retweets • 89 replies • 45 quotes
**Media:** 1 photo attached
- Photo: https://pbs.twimg.com/media/example.jpg
**Quote Tweet from @teslaofficial:**
> "Our latest Model S update includes new charging optimizations..."
https://api.fxtwitter.com/{username}/status/{tweet_id}Required System Tools:
curl - HTTP requests to APIsjq - JSON parsing and formattingbash - Script execution environmentgrep/sed - Text processing (Nitter fallback only)Optional Enhancements:
gdate (GNU date via Homebrew on macOS) - Better timestamp formattingApproved External Hosts:
api.fxtwitter.com - Primary data source (FxTwitter API)nitter.net and other Nitter instances - Fallback scrapingData Flow:
All network requests include:
Invalid URL Format:
{
"error": "Invalid Twitter/X URL format",
"expected": "x.com/user/status/123456789 or twitter.com/user/status/123456789"
}
Tweet Not Found:
{
"error": "API Error",
"code": 404,
"message": "NOT_FOUND"
}
Network Failure:
{
"error": "Failed to fetch tweet data",
"details": "Network request failed"
}
Fallback Needed:
{
"error": "All Nitter instances failed",
"suggestion": "Try the main script with FxTwitter API, or wait for Nitter instances to recover"
}
When errors occur:
Full thread unrolling is supported via read_thread.sh:
replying_to fields./scripts/read_thread.sh "https://x.com/user/status/123" [max_depth]media.photos array (full-resolution)media.videos with thumbnails and durationmedia.all array with type annotations for complete coveragemedia.article_cover extractedThe skill can extract nested quote tweets up to reasonable depth to avoid infinite loops.
"No tweet data in API response"
"Network request failed"
"All Nitter instances failed"
For debugging, run with verbose output:
bash -x scripts/read_tweet.sh "https://x.com/username/status/123"
To add additional fallback methods:
scripts/ directoryThe JSON structure can be customized by modifying the final jq command in each script. Maintain consistency across all methods.
Consider these enhancement areas:
read_thread.sh), comprehensive media extraction (photos, videos, all media, article covers)