twitter-to-binance-square by 6551team/6551-twitter-to-binance-square
npx skills add https://github.com/6551team/6551-twitter-to-binance-square --skill twitter-to-binance-square自动从指定的 Twitter 账户或关键词搜索获取推文,将内容转换为适合币安广场的格式并发布。专为构建自动化流程而设计,具有可配置的轮询间隔和去重功能。
| 项目 | 描述 | 如何获取 |
|---|---|---|
TWITTER_TOKEN | 6551 API Bearer token | 访问 https://6551.io/mcp 注册获取 |
SQUARE_API_KEY | Binance Square OpenAPI Key | 登录币安 → 访问 → 页面右侧「查看 API」申请 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
┌─────────────────────────────────────────────┐
│ 1. 获取: 从 Twitter/X 获取推文 │
│ - 按账户: 监控特定用户 │
│ - 按话题: 关键词/标签搜索 │
├─────────────────────────────────────────────┤
│ 2. 过滤: 去重和质量检查 │
│ - 跳过已发布的推文 ID │
│ - 跳过转推 / 回复 (可选) │
│ - 最低互动阈值 (可选) │
├─────────────────────────────────────────────┤
│ 3. 转换: 适配内容以适应广场格式 │
│ - 添加来源归属 │
│ - 按需翻译 │
│ - 添加相关 #标签 │
│ - 裁剪至广场长度限制 │
├─────────────────────────────────────────────┤
│ 4. 发布: 发布到币安广场 │
│ - 调用广场 API │
│ - 记录已发布推文 ID │
│ - 记录发布 URL │
├─────────────────────────────────────────────┤
│ 5. 等待: 按配置间隔休眠 │
│ - 默认: 300 秒 (5 分钟) │
│ - 遵守每日发布限制 │
└─────────────────────────────────────────────┘
curl -s -X POST "https://ai.6551.io/open/twitter_user_tweets" \
-H "Authorization: Bearer $TWITTER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"username": "TARGET_USERNAME",
"maxResults": 10,
"product": "Latest",
"includeReplies": false,
"includeRetweets": false
}'
curl -s -X POST "https://ai.6551.io/open/twitter_search" \
-H "Authorization: Bearer $TWITTER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"keywords": "TOPIC_KEYWORDS",
"minLikes": 50,
"product": "Top",
"maxResults": 10,
"lang": "en"
}'
curl -s -X POST "https://ai.6551.io/open/twitter_search" \
-H "Authorization: Bearer $TWITTER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"hashtag": "bitcoin",
"minLikes": 100,
"product": "Top",
"maxResults": 10
}'
curl -s -X POST "https://www.binance.com/bapi/composite/v1/public/pgc/openApi/content/add" \
-H "X-Square-OpenAPI-Key: $SQUARE_API_KEY" \
-H "Content-Type: application/json" \
-H "clienttype: binanceSkill" \
-d '{
"bodyTextOnly": "TRANSFORMED_CONTENT"
}'
将推文转换为币安广场格式时,应用以下规则:
{transformed_content}
Source: @{username} on X ← 可选 (show_source=true)
Publish by using 6551 twitter mirror tool ← 默认启用 (show_tool_attribution=true)
{#hashtag1} {#hashtag2} {#hashtag3}
Publish by using 6551 twitter mirror tool — 由 show_tool_attribution 控制 (默认: true)Source: @username on X — 由 show_source 控制 (默认: true)translate,则翻译为目标语言,同时保留技术术语原始推文 来自 @VitalikButerin:
Excited about the new EIP-4844 progress. Proto-danksharding will reduce L2 fees by 10-100x.
This is huge for Ethereum scalability. https://t.co/xxx
转换为币安广场格式 (show_source=true, show_tool_attribution=true):
Vitalik Buterin 对 EIP-4844 的最新进展感到兴奋。Proto-danksharding 将把 L2 费用降低 10-100 倍,这对以太坊的可扩展性意义重大。
Source: @VitalikButerin on X
Publish by using 6551 twitter mirror tool
#Ethereum #EIP4844 #L2 #Crypto
转换为币安广场格式 (show_source=false, show_tool_attribution=true):
Vitalik Buterin 对 EIP-4844 的最新进展感到兴奋。Proto-danksharding 将把 L2 费用降低 10-100 倍,这对以太坊的可扩展性意义重大。
Publish by using 6551 twitter mirror tool
#Ethereum #EIP4844 #L2 #Crypto
自动化脚本使用 JSON 配置文件 (参见 mirror_config.example.json):
{
"mode": "account",
"accounts": ["VitalikButerin", "cabornedefi"],
"keywords": "",
"hashtag": "",
"poll_interval_seconds": 300,
"min_likes": 0,
"min_retweets": 0,
"max_posts_per_run": 5,
"include_replies": false,
"include_retweets": false,
"translate": false,
"translate_to": "zh",
"content_template": "{content}\n\n{source_attribution}\n{tool_attribution}\n{hashtags}",
"show_source": true,
"show_tool_attribution": true,
"add_hashtags": ["Crypto", "Web3"],
"state_file": "mirror_state.json",
"dry_run": false
}
| 字段 | 类型 | 默认值 | 描述 |
|---|---|---|---|
mode | string | "account" | "account" = 监控用户, "search" = 关键词搜索, "hashtag" = 标签搜索 |
accounts | string[] | [] | 要监控的 Twitter 用户名 (mode=account) |
keywords | string | "" | 搜索关键词 (mode=search) |
hashtag | string | "" | 要监控的标签 (mode=hashtag) |
poll_interval_seconds | int | 300 | 每次轮询周期之间的秒数 |
min_likes | int | 0 | 符合镜像条件的最低点赞数 |
min_retweets | int | 0 | 符合镜像条件的最低转推数 |
max_posts_per_run | int | 5 | 每个轮询周期最大发布数 |
include_replies | bool | false | 包含回复推文 |
include_retweets | bool | false | 包含转推 |
translate | bool | false | 发布前翻译内容 |
translate_to | string | "zh" | 翻译的目标语言 |
content_template | string | 见上文 | 广场帖子内容模板 |
show_source | bool | true | 显示 Source: @username on X 归属 |
show_tool_attribution | bool | true | 显示 Publish by using 6551 twitter mirror tool |
add_hashtags | string[] | [] | 要附加的额外标签 |
state_file | string | "mirror_state.json" | 用于跟踪已发布推文 ID 的文件 |
dry_run | bool | false | 如果为 true,则打印内容但不发布 |
脚本维护一个 mirror_state.json 来跟踪已发布的推文:
{
"posted_tweet_ids": ["1234567890", "1234567891"],
"last_poll_time": "2026-03-07T10:00:00Z",
"post_count_today": 5,
"last_reset_date": "2026-03-07",
"post_log": [
{
"tweet_id": "1234567890",
"square_post_id": "298177291743282",
"square_url": "https://www.binance.com/square/post/298177291743282",
"username": "VitalikButerin",
"posted_at": "2026-03-07T10:05:00Z"
}
]
}
| 场景 | 操作 |
|---|---|
| Twitter API 失败 | 记录错误,下一个周期重试 |
| Square API 返回 20002/20022 (敏感词) | 记录并跳过此推文,继续 |
| Square API 返回 220009 (每日限制,最多 100 条/天) | 停止发布,等待到第二天 |
| Square API 返回 220004 (密钥过期) | 停止并提醒用户 |
| 推文已发布 (重复 ID) | 静默跳过 |
| 网络错误 | 使用指数退避重试 (最多 3 次) |
TWITTER_TOKEN 和 SQUARE_API_KEY 是否存在python3 scripts/auto_mirror.pyUser: Mirror VitalikButerin's tweets to my Binance Square
Agent: I'll set up auto-mirroring for @VitalikButerin → Binance Square.
Config:
- Mode: account
- Account: VitalikButerin
- Poll interval: 5 minutes
- Translate: No
Let me fetch the latest tweets first to preview...
[Fetches and shows latest tweet]
Here's how the first post would look on Binance Square:
---
Excited about the new EIP-4844 progress...
Source: @VitalikButerin on X
Publish by using 6551 twitter mirror tool
#Ethereum #Crypto
---
Shall I start the auto-mirror with these settings?
User: Auto-post trending Bitcoin tweets to Binance Square, minimum 500 likes
Agent: I'll monitor Twitter for popular Bitcoin tweets and mirror them to Binance Square.
Config:
- Mode: search
- Keywords: "bitcoin"
- Min likes: 500
- Poll interval: 10 minutes
Starting monitor...
# Set environment variables
export TWITTER_TOKEN="your_6551_token"
export SQUARE_API_KEY="your_square_key"
# Run with config file
python3 scripts/auto_mirror.py --config mirror_config.json
# Run with CLI args
python3 scripts/auto_mirror.py \
--mode account \
--accounts VitalikButerin,elonmusk \
--interval 300 \
--translate \
--translate-to zh
abc12...xyz9每周安装次数
77
代码仓库
GitHub Stars
12
首次出现
Mar 7, 2026
安全审计
安装于
codex72
gemini-cli72
kimi-cli72
cursor72
opencode72
github-copilot72
GitHub Actions 官方文档查询助手 - 精准解答 CI/CD 工作流问题
45,200 周安装
GitHub PR 自动审查工具 - 基于严重性优先级排序、应用修复与线程回复
369 周安装
子代理驱动开发 (SADD) 指南:AI 代理任务执行与代码审查流程详解
372 周安装
Reflexion:reflect 自我反思与迭代改进框架 - AI代码质量把关者
375 周安装
阿里云通义千问图像生成API:使用DashScope SDK实现AI图像创作与集成
365 周安装
Storybook故事编写指南:使用CSF3格式创建可维护组件故事
372 周安装
workflow-init:Vercel Workflow DevKit 自动化初始化工具,支持 Next.js/Nuxt/SvelteKit 等主流框架
382 周安装