x-api
Skill4 starsChanged 8 months agoApache-2.0View on GitHub
使用 X (Twitter) API v2 获取和发布推文、媒体、用户信息等数据。用于:获取指定用户的最新推文、搜索推文、获取用户信息、发布纯文本/带图片/带视频的推文。获取操作需要 X_BEARER_TOKEN,发布操作需要 OAuth 1.0a 四件套:X_API_KEY、X_API_SECRET、X_ACCESS_TOKEN、X_ACCESS_TOKEN_SECRET。当用户需要获取或发布 Twitter/X 上的推文、上传媒体文件(图片/视频)时触发。
- Reads credentials
35 other projects use a version of this.
Adopted by
Most recently taken up by
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- renepf/claude-skillstheir own version, first seen Oct 25, 2026
- davidanthonyn/claude-skillstheir own version, first seen Oct 20, 2026
- Xquik-dev/x-apitheir own version, first seen Oct 13, 2026
- gongyijie85/dsh-ecctheir own version, first seen Oct 13, 2026
- MohamedEssam0-0/claude-skillstheir own version, first seen Oct 11, 2026
Used with
Projects with it also use everything-claude-code-conventions, agent-sort and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
mryeastcodeSkilleverything-claude-code-conventions
Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.
Also in 8 projects that use this
niloykumarbarmanSkillagent-sort
Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.
Also in 8 projects that use this
InfopibeSkilleverything-claude-code
Also in 8 projects that use this
tpavanipradeepSkillbun-runtime
Bun as runtime, package manager, bundler, and test runner. When to choose Bun vs Node, migration notes, and Vercel support.
Also in 17 projects that use this
tpavanipradeepSkillnextjs-turbopack
Next.js 16+ and Turbopack — incremental bundling, FS caching, dev speed, and when to use Turbopack vs webpack.
Also in 14 projects that use this
niloykumarbarmanSkillproduct-capability
Translate PRD intent, roadmap asks, or product discussions into an implementation-ready capability plan that exposes constraints, invariants, interfaces, and unresolved decisions before multi-service work starts. Use when the user needs an ECC-native PRD-to-SRS lane instead of vague planning prose.
Also in 8 projects that use this
- +2 more from tpavanipradeep
- +1 more from niloykumarbarman
Other versions35 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 35
- affaan-m/ECC★ 246ksame name
- loulanyue/awesome-claude-notes★ 272same name
- tpavanipradeep/everything-claude-code★ 104same name
- mturac/everything-openai-codex★ 89same name
- mit-network/everything-claude-code★ 76same name
- joelhooks/joelclaw★ 66same name
- Fmarzochi/EGC★ 61same name
- ysyecust/everything-claude-code★ 44same name
- gongyijie85/dsh-ecc★ 8same name
- GPTtang/skill-atlas★ 4same name
25 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository47 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .claude/skills/f-fund-advisor/CLAUDE.mdCLAUDE.md
- .claude/skills/t-supabase/CLAUDE.mdCLAUDE.md
- agent-browserSkill
- find-skillsSkill
- skill-creatorSkill
- fund-advisorSkill
- fundamentalsSkill
- fund-assistantSkill
- fund-screenerSkill
- eastmoney_fin_dataSkill
- eastmoney_fin_searchSkill
- f-mx-select-stockSkill
- mx_self_selectSkill
- eastmoney_stock_simulatorSkill
- baoyu-article-illustratorSkill
- xhs-note-creatorSkill
- auto-wechatSkill
- auto-xSkill
- doubao-image-genSkill
- doubao-videoSkill
- minimaxSkill
- nano-banana2Skill
- remotion-best-practicesSkill
- suno-musicSkill
- whisper-subtitleSkill
- arxivSkill
- bar-chart-race-generatorSkill
- perfect-PPTmakerSkill
- tech-news-dailySkill
- yt-dlp-downloaderSkill
- brainstormingSkill
- dispatching-parallel-agentsSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- frontend-designSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- subagent-driven-developmentSkill
- supabase-postgres-best-practicesSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- using-git-worktreesSkill
- using-superpowersSkill
- verification-before-completionSkill
- writing-plansSkill
- writing-skillsSkill
The file
Files
X (Twitter) API
使用 X API v2 获取和发布推文、媒体、用户信息。
前置要求
只读操作(获取推文、搜索、用户信息)
export X_BEARER_TOKEN="你的 Bearer Token"发布推文(OAuth 1.0a)
export X_API_KEY="你的 Consumer Key"
export X_API_SECRET="你的 Consumer Secret"
export X_ACCESS_TOKEN="你的 Access Token"
export X_ACCESS_TOKEN_SECRET="你的 Access Token Secret"可用功能
1. 获取用户最新推文
使用 get_user_tweets.py 脚本获取指定用户的最新推文。
用法:
python scripts/get_user_tweets.py <username> [max_results]参数:
username(string): 用户名(不含 @)max_results(number, 可选): 返回推文数量,默认 5,最大 100
示例:
python scripts/get_user_tweets.py cheerselflin 5输出格式 (2026-02-28优化):
# 1. 2026-02-27 20:33
> I'll stick to being a dog mom thanks 🐶 https://t.co/sPRYAnTGwO
视频: https://video.twimg.com/amplify_video/.../xxx.mp4
预览图: https://pbs.twimg.com/amplify_video_thumb/.../xxx.jpg
❤️793 🔄13 💬39 🔁1格式说明:
- 标题:
# 序号. YYYY-MM-DD HH:MM - 推文内容:
> 引用块展示原文 - 媒体:
图片: https://.../视频: https://.../预览图: https://... - 统计:
❤️likes 🔄RTs 💬回复 🔁quotes - 无 Markdown 图像语法
(飞书/飞书文档不渲染) - 无代码块
2. 搜索推文
使用 search_tweets.py 脚本搜索公开推文。
用法:
python scripts/search_tweets.py "<query>" [max_results]参数:
query(string): 搜索查询(支持 X 搜索语法,如 "from:username"、"#hashtag")max_results(number, 可选): 返回推文数量,默认 10,最大 100
示例:
python scripts/search_tweets.py "from:cheerselflin" 53. 获取用户信息
使用 get_user_info.py 脚本获取用户详细信息。
用法:
python scripts/get_user_info.py <username>示例:
python scripts/get_user_info.py cheerselflin4. 发布推文
使用 post_tweet.py 脚本发布推文。
用法:
python scripts/post_tweet.py "推文内容"参数:
text(string): 推文内容,最多 280 字符
环境变量要求: 发布推文需要 OAuth 1.0a 认证(用户上下文):
X_API_KEY- API Key (Consumer Key)X_API_SECRET- API Secret (Consumer Secret)X_ACCESS_TOKEN- Access TokenX_ACCESS_TOKEN_SECRET- Access Token Secret
如何获取 OAuth 凭证:
- 前往 X Developer Portal
- 进入你的项目/应用 → "Keys and Tokens"
- 生成 "Access Token and Secret"(需要有 Write 权限)
- 如果应用权限变更过,需要重新生成 Access Token
示例:
# 发布纯文本推文
python scripts/post_tweet.py "Hello, X!"
# 发布带图片的推文
python scripts/post_tweet.py "Check out this photo!" --media ./photo.jpg
# 发布带多张图片的推文(最多4张)
python scripts/post_tweet.py "Multiple images" -m ./img1.jpg -m ./img2.jpg -m ./img3.jpg
# 使用已上传的 media_id
python scripts/post_tweet.py "Using media id" --media-id 12345678905. 上传媒体文件
使用 upload_media.py 脚本上传图片或视频(供后续发推文使用)。
用法:
python scripts/upload_media.py <文件路径>支持的格式: JPG, PNG, GIF, WEBP, MP4, MOV
示例:
python scripts/upload_media.py ./my-image.png返回: Media ID,可用于 post_tweet.py --media-id
技能组合 Workflow
生成视频并发布到 X
结合 generate-video skill 和 x-api skill:
# 1. 生成视频(使用豆包视频生成)
cd .claude/skills/generate-video/scripts
python text_to_video.py "可爱猫咪在阳光下打盹" -t 5 -r 1:1
# 2. 上传视频到 X
cd .claude/skills/x-api/scripts
python upload_media.py /path/to/video.mp4
# 3. 获取 Media ID 后发布推文
python post_tweet.py "🐱 AI生成的视频" --media-id <MEDIA_ID>脚本文件
| 脚本 | 功能 | 认证方式 |
get_user_tweets.py | 获取用户推文 | Bearer Token |
search_tweets.py | 搜索推文 | Bearer Token |
get_user_info.py | 获取用户信息 | Bearer Token |
post_tweet.py | 发布推文 | OAuth 1.0a |
upload_media.py | 上传媒体文件 | OAuth 1.0a |
错误处理
只读操作错误
401- 认证失败,检查 Bearer Token403- 超出请求限制404- 用户不存在429- 请求过于频繁,需要等待重置
发布推文错误
401- OAuth 认证失败,检查 API Key/Secret 和 Access Token403- 权限不足,确保应用有 "Read and Write" 权限且 Token 已刷新429- 请求过于频繁或日推数限制
注意事项
- 请求限制: X API v2 有速率限制
- 数据保留:
search/recent仅返回最近 7 天的推文 - 认证方式:
- 只读操作:Bearer Token(应用上下文)
- 发布推文:OAuth 1.0a(用户上下文)
- 发布权限: 发布推文需要应用在 X Developer Portal 中启用 "Read and Write" 权限,且 Access Token 需要重新生成以应用新权限
参考文档
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

