当前位置: 首页 > Skill >

Twitter/X Reader

Twitter/X Reader

Twitter/X Reader

通过URL提取X/Twitter推文的完整数据,包括文本、作者信息、时间戳、互动统计、媒体、引用推文及对话上下文。

1.0.0 2026.11.24 739
获取Skill文件查看使用说明
作 者:许辰 许可证: 更新时间:2026.11.24
本文目录展开

Twitter/X Reader Skill

A comprehensive skill for reading and extracting data from X (formerly Twitter) tweets using multiple reliable data sources.

Overview

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.

When to Use

Primary Triggers:

  • User shares a tweet URL (x.com//status/ or twitter.com//status/)
  • User asks to "read this tweet" with a URL
  • User requests tweet analysis, summary, or data extraction
  • User mentions getting information from a specific tweet

Example User Requests:

  • "What does this tweet say? https://x.com/elonmusk/status/123456789"
  • "Can you read this tweet for me?"
  • "Summarize this Twitter thread"
  • "What are the engagement stats on this tweet?"
  • "Extract the media from this tweet"

Capabilities

Data Extracted

  • Tweet Content: Full text with proper formatting
  • Author Information: Display name and handle (@username)
  • Timestamps: Both human-readable and original format
  • Engagement Stats: Likes, retweets, replies, quote tweets
  • Media Attachments: Photos and videos with direct URLs
  • Quote Tweets: Full quoted tweet content and author info
  • Thread Context: When available

Supported URL Formats

  • https://x.com/username/status/1234567890
  • https://twitter.com/username/status/1234567890
  • URLs with query parameters (e.g., ?s=20, ?t=abc123)
  • Mobile URLs (m.twitter.com automatically handled)

Usage Examples

Basic Usage

# 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"

Agent Instructions

When a user provides a tweet URL:

  1. Validate the URL format - ensure it's a valid X/Twitter status URL
  2. Use the primary script - scripts/read_tweet.sh first
  3. Handle failures gracefully - if primary fails, try scripts/read_tweet_nitter.sh
  4. Present data clearly - format the output for human consumption
  5. Preserve context - include engagement stats and media references

Sample Response Format

The 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
}

Agent Response Example

**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..."

Technical Implementation

Primary Method: FxTwitter API

  • Endpoint: https://api.fxtwitter.com/{username}/status/{tweet_id}
  • Advantages: No authentication, comprehensive data, reliable
  • Rate Limits: Generous for personal use
  • Response: Complete JSON with all tweet metadata

Fallback Method: Nitter Scraping (Best-Effort)

  • Instances: Multiple public Nitter instances as backup
  • Advantages: Works when FxTwitter is unavailable
  • Limitations: Basic data extraction, no engagement stats
  • Usage: Automatic fallback when primary method fails
  • ⚠️ Note: Most public Nitter instances have shut down or become unreliable since 2024. This fallback is best-effort and may not return results. The FxTwitter API should be considered the only reliable method.

Error Handling

  • Invalid URL format detection
  • Network timeout handling
  • API error response parsing
  • Graceful fallback between methods
  • Clear error messages for users

Dependencies

Required System Tools:

  • curl - HTTP requests to APIs
  • jq - JSON parsing and formatting
  • bash - Script execution environment
  • grep/sed - Text processing (Nitter fallback only)

Optional Enhancements:

  • gdate (GNU date via Homebrew on macOS) - Better timestamp formatting

Security & Privacy

Security Features

  • ✅ No external data collection - Data stays on your system
  • ✅ No analytics or telemetry - No tracking or usage reporting
  • ✅ Fully auditable code - Open source, readable shell scripts
  • ✅ Minimal network calls - Only to FxTwitter API and Nitter instances
  • ✅ No sensitive data exposure - Scripts don't store or log personal info
  • ✅ Safe URL handling - Proper URL validation and sanitization

Network Connections

Approved External Hosts:

  • api.fxtwitter.com - Primary data source (FxTwitter API)
  • nitter.net and other Nitter instances - Fallback scraping
  • No other external connections made

Data Flow:

  1. User provides tweet URL
  2. Script extracts username/ID from URL
  3. Makes API request to FxTwitter or Nitter
  4. Parses response locally
  5. Returns formatted JSON (never stored permanently)

Audit Trail

All network requests include:

  • Clear user-agent identification
  • Minimal necessary headers only
  • No authentication tokens or personal identifiers
  • Requests only to extract public tweet data

Error Scenarios & Handling

Common Errors

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"
}

Agent Error Handling

When errors occur:

  1. Parse the error JSON to understand the issue
  2. Try the fallback method if primary fails
  3. Explain to the user what went wrong in plain language
  4. Suggest alternatives (try again later, check URL format, etc.)

Advanced Features

Thread Reading

Full thread unrolling is supported via read_thread.sh:

  • Given any tweet URL in a thread, walks UP the reply chain via replying_to fields
  • Only collects tweets from the same author (self-reply threads)
  • Returns tweets in chronological order as a JSON array
  • Safety limit of 50 tweets per thread (configurable via second argument)
  • Usage: ./scripts/read_thread.sh "https://x.com/user/status/123" [max_depth]

Media Handling

  • Photos: Direct URLs via media.photos array (full-resolution)
  • Videos: Links to MP4 files via media.videos with thumbnails and duration
  • All media: Combined media.all array with type annotations for complete coverage
  • Article covers: Long-form X posts ("articles") have media.article_cover extracted
  • GIFs: Handled as video content
  • External Links: Preserved in tweet text

Quote Tweet Recursion

The skill can extract nested quote tweets up to reasonable depth to avoid infinite loops.

Performance Notes

Response Times

  • FxTwitter API: Typically 200-500ms
  • Nitter Scraping: 1-3 seconds per instance
  • Network Dependent: May vary based on connection quality

Caching Considerations

  • No persistent caching implemented by default
  • Consider temporary caching for repeated requests
  • Respect rate limits of external services

Troubleshooting

Common Issues

"No tweet data in API response"

  • Tweet may be deleted or protected
  • Check URL format and tweet ID
  • Try fallback method

"Network request failed"

  • Check internet connection
  • FxTwitter API may be temporarily down
  • Fallback to Nitter method

"All Nitter instances failed"

  • Nitter instances may be blocked or down
  • Wait and retry with FxTwitter API
  • Check firewall/proxy settings

Debug Mode

For debugging, run with verbose output:

bash -x scripts/read_tweet.sh "https://x.com/username/status/123"

Development & Customization

Adding New Data Sources

To add additional fallback methods:

  1. Create new script in scripts/ directory
  2. Follow same JSON output format
  3. Update main skill logic to include new method
  4. Test thoroughly and update documentation

Modifying Output Format

The JSON structure can be customized by modifying the final jq command in each script. Maintain consistency across all methods.

Adding Features

Consider these enhancement areas:

  • Sentiment analysis of tweet content
  • Hashtag and mention extraction
  • Link expansion and preview
  • Image OCR for text in media
  • Translation support for non-English tweets

Version History

  • v1.1 - Thread following (read_thread.sh), comprehensive media extraction (photos, videos, all media, article covers)
  • v1.0 - Initial release with FxTwitter API and Nitter fallback
  • Multi-source reliability with comprehensive data extraction
  • Full security audit compliance
  • Production-ready for ClawHub distribution

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • Twitter/X Reader Skill
    • Overview
    • When to Use
    • Capabilities
      • Data Extracted
      • Supported URL Formats
    • Usage Examples
      • Basic Usage
      • Agent Instructions
      • Sample Response Format
      • Agent Response Example
    • Technical Implementation
      • Primary Method: FxTwitter API
      • Fallback Method: Nitter Scraping (Best-Effort)
      • Error Handling
    • Dependencies
    • Security & Privacy
      • Security Features
      • Network Connections
      • Audit Trail
    • Error Scenarios & Handling
      • Common Errors
      • Agent Error Handling
    • Advanced Features
      • Thread Reading
      • Media Handling
      • Quote Tweet Recursion
    • Performance Notes
      • Response Times
      • Caching Considerations
    • Troubleshooting
      • Common Issues
      • Debug Mode
    • Development & Customization
      • Adding New Data Sources
      • Modifying Output Format
      • Adding Features
    • Version History
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期