网淘吧来吧,欢迎您!

X Tweet Fetcher

2026-03-29 新闻来源:网淘吧 围观:17
电脑广告
手机广告

X推文获取器

无需身份验证即可从X/Twitter获取推文。使用FxTwitter API。

可获取内容

内容类型支持情况
常规推文✅ 完整文本 + 统计数据
长推文(Twitter Blue)✅ 完整文本
X文章(长文)✅ 完整文章内容
引用推文✅ 包含
统计数据(点赞/转发/浏览量)✅ 包含

使用方法

命令行界面

# JSON output
python3 scripts/fetch_tweet.py --url "https://x.com/user/status/123456"

# Pretty JSON
python3 scripts/fetch_tweet.py --url "https://x.com/user/status/123456" --pretty

# Text only (human readable)
python3 scripts/fetch_tweet.py --url "https://x.com/user/status/123456" --text-only

从Agent代码调用

from scripts.fetch_tweet import fetch_tweet

result = fetch_tweet("https://x.com/user/status/123456")
tweet = result["tweet"]

# Regular tweet
print(tweet["text"])

# X Article (long-form)
if tweet["is_article"]:
    print(tweet["article"]["title"])
    print(tweet["article"]["full_text"])  # Complete article
    print(tweet["article"]["word_count"])

输出格式

{
  "url": "https://x.com/user/status/123",
  "username": "user",
  "tweet_id": "123",
  "tweet": {
    "text": "Tweet content...",
    "author": "Display Name",
    "screen_name": "username",
    "likes": 100,
    "retweets": 50,
    "bookmarks": 25,
    "views": 10000,
    "replies_count": 30,
    "created_at": "Mon Jan 01 12:00:00 +0000 2026",
    "is_note_tweet": false,
    "is_article": true,
    "article": {
      "title": "Article Title",
      "full_text": "Complete article content...",
      "word_count": 4847,
      "char_count": 27705
    }
  }
}

系统要求

  • Python 3.7+
  • 无需外部包(仅使用标准库)
  • 无需API密钥
  • 无需登录

工作原理

用途使用FxTwitter的公共API (api.fxtwitter.com

)来代理X/Twitter内容。文章以结构化数据块的形式返回,并重新组合成完整文本。

  • 限制无法获取回复线程(只能通过replies_count
    • 字段获取回复数量)
    • 获取回复内容需要浏览器自动化依赖(Camofox/Nitter)
    • 这些依赖已被移除,以保持零依赖架构--replies
  • 标志存在,但会返回解释性错误信息
  • 无法获取已删除或私密的推文
  • 速率限制取决于FxTwitter服务的可用性

如果FxTwitter服务中断,该功能将无法工作(无备用方案)

skills/x-tweet-fetcher/
├── SKILL.md              (this file)
└── scripts/
    └── fetch_tweet.py    (single file, zero deps)
免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏
文章底部电脑广告
手机广告位-内容正文底部
上一篇:Project Manager 下一篇:iOS Simulator Skill

相关文章

您是本站第316660名访客 今日有11篇新文章/评论