fetch-tweet
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFetch Tweet
获取推文
X/Twitter URL에서 트윗 원문, 작성자 정보, 인게이지먼트 데이터를 가져오는 스킬.
FxEmbed 오픈소스 프로젝트의 API ()를 활용하여 JavaScript 없이 트윗 데이터를 추출한다.
api.fxtwitter.com这是一款从X/Twitter链接中获取推文原文、作者信息、互动数据的技能。它利用FxEmbed开源项目的API (),无需JavaScript即可提取推文数据。
api.fxtwitter.comHow It Works
工作原理
X/Twitter URL의 도메인을 으로 변환하면 JSON으로 트윗 전체 데이터를 반환한다.
api.fxtwitter.comhttps://x.com/user/status/123456
→ https://api.fxtwitter.com/user/status/123456将X/Twitter链接的域名替换为,即可获取包含完整推文数据的JSON响应。
api.fxtwitter.comhttps://x.com/user/status/123456
→ https://api.fxtwitter.com/user/status/123456Script
脚本
scripts/fetch_tweet.pybash
undefinedscripts/fetch_tweet.pybash
undefined기본 사용 (포맷팅된 출력)
基础使用(格式化输出)
python scripts/fetch_tweet.py https://x.com/garrytan/status/2020072098635665909
python scripts/fetch_tweet.py https://x.com/garrytan/status/2020072098635665909
JSON 출력 (프로그래밍 활용)
JSON输出(用于编程)
python scripts/fetch_tweet.py https://x.com/garrytan/status/2020072098635665909 --json
지원 URL 형식: `x.com`, `twitter.com`, `fxtwitter.com`, `fixupx.com`python scripts/fetch_tweet.py https://x.com/garrytan/status/2020072098635665909 --json
支持的链接格式:`x.com`、`twitter.com`、`fxtwitter.com`、`fixupx.com`API Response Fields
API响应字段
| 필드 | 설명 |
|---|---|
| 트윗 본문 (URL 확장됨) |
| 작성자 (name, screen_name, bio, followers) |
| 인게이지먼트 |
| 작성 일시 |
| 첨부 미디어 (photos, videos) |
| 인용 트윗 (동일 구조) |
| 언어 코드 |
| 字段 | 说明 |
|---|---|
| 推文正文(URL已展开) |
| 作者(姓名、用户名、简介、粉丝数) |
| 互动数据 |
| 发布时间 |
| 附加媒体(图片、视频) |
| 引用推文(结构相同) |
| 语言代码 |
Workflow
工作流程
단일 트윗 가져오기
获取单条推文
- URL에서 screen_name과 status_id를 추출
- 실행
scripts/fetch_tweet.py <url> - 결과를 사용자에게 표시하거나 번역
- 从链接中提取用户名(screen_name)和状态ID(status_id)
- 运行
scripts/fetch_tweet.py <url> - 向用户展示结果或进行翻译
번역 요청 시
当请求翻译时
- 스크립트로 원문 fetch
- 가져온 텍스트를 한국어로 번역하여 제공
- 인게이지먼트 수치도 함께 표시
- 通过脚本获取原文
- 将获取的文本翻译成韩语并提供
- 同时显示互动数据
다른 스킬과 연동
与其他技能联动
Contents Hub 등에서 수집한 X URL 목록을 일괄 처리할 때:
bash
undefined在Contents Hub等工具中批量处理收集到的X链接时:
bash
undefinedJSON 출력으로 파이프라인 연동
JSON输出用于流水线联动
python scripts/fetch_tweet.py <url> --json | python3 -c "import sys,json; print(json.load(sys.stdin)['tweet']['text'])"
undefinedpython scripts/fetch_tweet.py <url> --json | python3 -c "import sys,json; print(json.load(sys.stdin)['tweet']['text'])"
undefinedWebFetch Fallback
WebFetch备选方案
스크립트 실행이 어려운 경우 WebFetch 도구로 직접 API 호출 가능:
URL: https://api.fxtwitter.com/{screen_name}/status/{status_id}
Prompt: "Extract the full tweet text and author name"当无法运行脚本时,可使用WebFetch工具直接调用API:
URL: https://api.fxtwitter.com/{screen_name}/status/{status_id}
Prompt: "Extract the full tweet text and author name"Limitations
限制
- 비공개 계정 트윗은 조회 불가
- 삭제된 트윗은 조회 불가
- API rate limit은 FxEmbed 서버 정책에 따름 (일반 사용 수준에서는 문제 없음)
- 无法查看私人账号的推文
- 无法查看已删除的推文
- API调用限制遵循FxEmbed服务器政策(普通使用场景下无问题)