首页龙虾技能列表 › X Publisher — 通过 X API v2 和 OAuth 1.0a 发布推文

X Publisher — 通过 X API v2 和 OAuth 1.0a 发布推文

v1.0.0

使用 X (Twitter) API v2 和 OAuth 1.0a 发布推文、线程、回复和引用推文。支持多种操作,如点赞、删除和时间线获取。

0· 136·0 当前·0 累计
by @3rdbrain (pbopps)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/3/22
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
该技能的代码、要求和指令与 Twitter (X) 发布实用工具一致,所请求的凭据与其目的匹配;未发现隐藏的数据外泄或不相关的特权。
评估建议
该技能如其所述:使用您提供的四个 X/Twitter 凭据来模拟该账户并发布/读取推文。安装前,请注意:(1)仅提供您控制并愿意自动化的账户凭据;(2)自行或与信任人员一起审查 `x-api.js`;(3)注意 `SKILL.md` 中提到的调度/cron 支持,但代码未实现调度;(4)技能来源未知/第三方;(5)确保环境中有 Node >=18。...
详细分析 ▾
用途与能力
Name/description match the code and required environment variables (X API key/secret and access token/secret). The included x-api.js implements posting, threading, replies, quote-tweets, likes, deletes, and timeline reads against api.twitter.com/2 using OAuth 1.0a — these require the declared credentials and are proportionate to the stated purpose.
指令范围
SKILL.md directs running the bundled Node script at /root/.openclaw/skills/x-api/x-api.js and warns against using other tools. That is unusual but not inherently malicious. One inconsistency: SKILL.md documents scheduling commands (schedule, schedule-thread) and says posts are 'saved to queue, posted by cron', but the provided x-api.js contains no scheduling/queue/cron implementation. Otherwise the runtime instructions primarily call the included script and do not request unrelated files or system data.
安装机制
No install spec; the skill is instruction-plus-code only. No downloads from external URLs or package installs are present. The single JavaScript file has a clear purpose and no obfuscated or unusual install actions.
凭证需求
Only four environment variables are required and they are precisely the OAuth 1.0a consumer key/secret and access token/secret needed to act as the user account. No unrelated credentials, config paths, or broad secrets are requested.
持久化与权限
The skill does not request always:true and does not modify other skills or system-wide settings. It will run the bundled script which has normal network access to Twitter APIs; autonomous invocation is allowed by default (not flagged on its own).
x-api.js:39
Environment variable access combined with network send.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/3/22

初始发布,带来新的流线化 Node.js 基础的 Twitter (X) API 发布工具。- 完全重写:现在使用单个脚本 (`x-api.js`) 对所有 X (Twitter) 操作通过 API v2 和 OAuth 1.0a。- 支持推文、线程、回复、引用推文、点赞、删除、时间线获取和调度。- 仅通过环境变量进行身份验证——无依赖项或外部 Python 脚本。- 删除了所有以前的脚本和替代工具的文档。- 输出清晰的 JSON,便于集成和错误检查。

● 无害

安装命令 点击复制

官方npx clawhub@latest install x-leads-api
镜像加速npx clawhub@latest install x-leads-api --registry https://cn.clawhub-mirror.com

技能文档

重要:先阅读

您控制 X (Twitter) 账户 通过脚本 /root/.openclaw/skills/x-api/x-api.js。没有 twitter 命令,没有 Python,没有 pip 在这个容器中。不要搜索其他工具。不要尝试使用 curl 与 OAuth 头。不要尝试安装任何东西。发布推文的唯一方式是:
node /root/.openclaw/skills/x-api/x-api.js post "您的推文文本在这里"
此脚本使用您的配置 API 密钥自动处理所有 OAuth 1.0a 签名。只需运行它即可。

命令

发布推文:
node /root/.openclaw/skills/x-api/x-api.js post "Hello world! 这是我的第一条推文。"
发布线程(多个连接的推文):
node /root/.openclaw/skills/x-api/x-api.js thread "线程的第一条推文" "线程的第二条推文..." "线程的第三条推文..."
回复推文:
node /root/.openclaw/skills/x-api/x-api.js reply 1234567890 "这是我的回复"
引用推文:
node /root/.openclaw/skills/x-api/x-api.js quote 1234567890 "有趣的观点!"
点赞推文:
node /root/.openclaw/skills/x-api/x-api.js like 1234567890
删除推文:
node /root/.openclaw/skills/x-api/x-api.js delete 1234567890
检查最近的推文:
node /root/.openclaw/skills/x-api/x-api.js timeline 10
安排推文在后面发布(保存到队列,通过 cron 发布):
node /root/.openclaw/skills/x-api/x-api.js schedule "早上好!" "2026-02-22T09:00:00Z"
安排线程在后面发布:
node /root/.openclaw/skills/x-api/x-api.js schedule-thread "推文 1" "推文 2" "2026-02-22T09:00:00Z"

如何工作

  • 脚本使用 Node.js 内置 crypto 模块 —— 零依赖
  • 自动完成 OAuth 1.0a HMAC-SHA1 签名
  • 通过环境变量读取 API 凭据
  • 输出 JSON 格式 { success: true/false, data: {...}, summary: "..." }

重要规则

  • 始终使用 node /root/.openclaw/skills/x-api/x-api.js —— 这是您的 Twitter 工具
  • 永远不要尝试 pip installpythoncurl 与 OAuth 或其他方法
  • 推文文本最大 280 个字符
  • 线程最大 25 条推文
  • 脚本返回 JSON —— 检查 success 字段以确认它是否工作

环境变量

  • X_API_KEY —— X API 密钥 (OAuth 1.0a 消费者密钥)
  • X_API_SECRET —— X API 秘密
  • X_ACCESS_TOKEN —— 访问令牌
  • X_ACCESS_SECRET —— 访问令牌秘密
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务