Twitter Agent Skill
IMPORTANT: Use the exec tool to run all commands below. Do NOT just display them.
Automates Twitter/X operations for an AI+Crypto account: post original tweets, reply to KOLs, and quote tweet trending content.
Prerequisites
You need:
- 1. Twitter Developer Account — get API keys at https://developer.x.com
- 6551 API Token (
TWITTER_TOKEN) — get at https://6551.io/mcp (for hot topic fetching)
When installing, OpenClaw will prompt you to fill in each env variable.
Required env vars
| Variable | Where to get |
|---|
| INLINECODE1 | developer.x.com → Your App → OAuth 1.0a Keys |
| INLINECODE2 |
developer.x.com → Your App → OAuth 1.0a Keys |
|
TW_ACCESS_TOKEN | developer.x.com → Your App → Generate (Read+Write) |
|
TW_ACCESS_TOKEN_SECRET | developer.x.com → Your App → Generate (Read+Write) |
|
TWITTER_TOKEN | https://6551.io/mcp |
Important: Set your Twitter App permissions to Read and Write before generating the Access Token.
Operations
1. Post a tweet
CODEBLOCK0
With image:
CODEBLOCK1
2. Reply to a tweet
CODEBLOCK2
3. Quote tweet
CODEBLOCK3
Full AI+Crypto workflow
Step 1 — Fetch trending tweets (via 6551 opentwitter)
CODEBLOCK4
Fetch KOL tweets:
CODEBLOCK5
Step 2 — Generate content (Agent handles this)
Based on trending tweets, generate one of:
- - Original tweet: Insightful AI/Crypto take, ≤280 chars
- Reply: Unique perspective, not robotic, ≤120 chars
- Quote: One punchy line that adds value
Guidelines:
- - Write in English (target: English-speaking Crypto/AI community)
- Have a real opinion, avoid generic takes
- Max 1–2 emojis
Step 3 — Publish
Call the appropriate script from Step 1 above.
Output format
All scripts return JSON:
{
"success": true,
"tweet_id": "1234567890",
"url": "https://x.com/username/status/1234567890",
"text": "Published content"
}
Rate limit notes
- - Free tier: 1,500 tweets/month write limit
- Recommended intervals: ≥10 min between posts, ≥5 min between replies
- Avoid replying to the same account many times in a short window
Twitter Agent 技能
重要提示:请使用 exec 工具运行以下所有命令。不要仅显示它们。
为 AI+Crypto 账户自动化 Twitter/X 操作:发布原创推文、回复 KOL 以及引用转发热门内容。
前提条件
你需要:
- 1. Twitter 开发者账户 — 在 https://developer.x.com 获取 API 密钥
- 6551 API 令牌 (TWITTER_TOKEN) — 在 https://6551.io/mcp 获取(用于热门话题抓取)
安装时,OpenClaw 会提示你填写每个环境变量。
必需的环境变量
| 变量 | 获取位置 |
|---|
| TWCONSUMERKEY | developer.x.com → 你的应用 → OAuth 1.0a 密钥 |
| TWCONSUMERSECRET |
developer.x.com → 你的应用 → OAuth 1.0a 密钥 |
| TW
ACCESSTOKEN | developer.x.com → 你的应用 → 生成(读取+写入) |
| TW
ACCESSTOKEN_SECRET | developer.x.com → 你的应用 → 生成(读取+写入) |
| TWITTER_TOKEN | https://6551.io/mcp |
重要提示:在生成访问令牌之前,请将你的 Twitter 应用权限设置为读取和写入。
操作
1. 发布推文
bash
python3 $SKILLDIR/scripts/twitterpost.py --text 你的推文内容(最多 280 个字符)
带图片:
bash
python3 $SKILLDIR/scripts/twitterpost.py --text 推文内容 --image /path/to/image.png
2. 回复推文
bash
python3 $SKILLDIR/scripts/twitterreply.py --tweet_id 推文ID --text 你的回复
3. 引用推文
bash
python3 $SKILLDIR/scripts/twitterquote.py --tweet_id 推文ID --text 你的评论
完整的 AI+Crypto 工作流程
第一步 — 获取热门推文(通过 6551 opentwitter)
bash
curl -s -X POST https://ai.6551.io/open/twitter_search \
-H Authorization: Bearer $TWITTER_TOKEN \
-H Content-Type: application/json \
-d {keywords: AI crypto, minLikes: 500, product: Top, maxResults: 10}
获取 KOL 推文:
bash
curl -s -X POST https://ai.6551.io/open/twitterusertweets \
-H Authorization: Bearer $TWITTER_TOKEN \
-H Content-Type: application/json \
-d {username: VitalikButerin, maxResults: 5}
第二步 — 生成内容(由 Agent 处理)
基于热门推文,生成以下之一:
- - 原创推文:有见地的 AI/Crypto 观点,≤280 字符
- 回复:独特的视角,不机械,≤120 字符
- 引用:一句精辟的评论,增加价值
指南:
- - 使用英文撰写(目标受众:英语 Crypto/AI 社区)
- 表达真实观点,避免泛泛而谈
- 最多 1–2 个表情符号
第三步 — 发布
调用上述第一步中的相应脚本。
输出格式
所有脚本返回 JSON:
json
{
success: true,
tweet_id: 1234567890,
url: https://x.com/username/status/1234567890,
text: 已发布的内容
}
速率限制说明
- - 免费套餐:每月 1,500 条推文的写入限制
- 建议间隔:发布之间 ≥10 分钟,回复之间 ≥5 分钟
- 避免在短时间内多次回复同一个账户