"Help me sync my tweets to Binance Square"
That's it. Claude handles everything else.
|
7-layer filter chain automatically skips:
|
|
docker compose up -d --build
|
|
graph LR
A[🐦 Twitter/X] -->|Playwright XHR| B[Fetcher]
B -->|Raw Tweets| C[Filter]
C -->|7-Layer Chain| D[Processor]
D -->|Clean Text| E[Publisher]
E -->|OpenAPI POST| F[🟡 Binance Square]
G[(SQLite DB)] ---|Cursor & Dedup| B
G ---|Status & Retry| E
H[📢 Discord] ---|Alerts & Digest| E
I[⏰ Scheduler] ---|60min Loop| B
style A fill:#1DA1F2,color:#fff
style F fill:#F0B90B,color:#000
style G fill:#003B57,color:#fff
style H fill:#5865F2,color:#fff
| Item | Required | How to Get | |
|---|---|---|---|
| 🐦 | Twitter Username | ✅ | The @handle you want to monitor |
| 🟡 | Binance Square API Key | ✅ | Guide → ⏱️ Creator approval: 24-48h |
| 🍪 | Twitter Cookie (JSON) | ✅ | Guide → 🔧 via Cookie-Editor |
| 💬 | Discord Bot Token | ❌ | Guide → Optional notifications |
Tip
Claude Code users: Just say "帮我把推文同步到币安广场" — Claude will ask you 3 questions and handle everything automatically. No commands needed.
📋 Manual Setup (click to expand)
# 1. Generate project
python3 scripts/init_project.py \
--twitter-username TARGET_HANDLE \
--output-dir ~/twitter-sync
# 2. Configure credentials
cd ~/twitter-sync
# Edit .env → add your Binance API Key
# Copy Cookie-Editor export → cookies/twitter.json
# 3. Validate & deploy
python3 validate_config.py
docker compose up -d --build
# 4. Test (dry run, no actual posting)
docker exec twitter-sync python main.py --testClick to expand
twitter-binance-sync/
├── 📄 SKILL.md # Skill definition (Claude reads this)
├── 📖 README.md # You are here
├── 📜 LICENSE # MIT License
├── 🔧 scripts/
│ ├── init_project.py # Project scaffolding
│ ├── validate_config.py # Pre-deploy validation
│ └── health_check.py # Runtime diagnostics
├── 📚 references/
│ ├── architecture.md # Pipeline deep-dive
│ ├── twitter-cookies-guide.md # Cookie export tutorial
│ ├── binance-api-guide.md # API key setup
│ ├── discord-bot-guide.md # Bot creation
│ ├── vps-deployment-guide.md # Docker deployment
│ ├── troubleshooting.md # Error codes & fixes
│ └── customization-guide.md # Extend & customize
└── 📦 assets/templates/ # Complete deployable project
├── main.py # Entry point
├── Dockerfile # Non-root container
├── docker-compose.yml # Orchestration
└── modules/ # Pipeline modules
├── fetcher.py # Playwright tweet fetcher
├── filter.py # 7-layer filter chain
├── processor.py # Text cleanup
├── publisher.py # Binance Square API
├── db.py # SQLite persistence
├── scheduler.py # Sync orchestration
└── notifier.py # Discord notifications
| Document | Description | |
|---|---|---|
| 🏗️ | Architecture | Data flow, SQLite schema, state machine, cursor |
| 🍪 | Twitter Cookies | Cookie-Editor export walkthrough |
| 🟡 | Binance API | Key setup, endpoints, error codes |
| 💬 | Discord Bot | Bot creation & channel config |
| 🐳 | Deployment | Docker install & deploy |
| 🔧 | Troubleshooting | 7 common scenarios & fixes |
| ⚙️ | Customization | Filters, platforms, multi-account |
|
七层过滤链自动跳过:
|
|
docker compose up -d --build
|
|
| 项目 | 必需 | 获取方式 | |
|---|---|---|---|
| 🐦 | Twitter 用户名 | ✅ | 你想监控的 @用户名 |
| 🟡 | 币安广场 API Key | ✅ | 教程 → ⏱️ 创作者审批 24-48 小时 |
| 🍪 | Twitter Cookie(JSON) | ✅ | 教程 → 🔧 通过 Cookie-Editor 导出 |
| 💬 | Discord Bot Token | ❌ | 教程 → 可选通知功能 |
Tip
Claude Code 用户:直接说 "帮我把推文同步到币安广场",Claude 只会问你 3 个问题,然后全自动完成配置和部署。不需要你输入任何命令。
📋 手动配置(点击展开)
# 1. 生成项目
python3 scripts/init_project.py \
--twitter-username 目标用户名 \
--output-dir ~/twitter-sync
# 2. 配置凭证
cd ~/twitter-sync
# 编辑 .env → 填入币安 API Key
# Cookie-Editor 导出 → cookies/twitter.json
# 3. 校验并部署
python3 validate_config.py
docker compose up -d --build
# 4. 测试(不实际发帖)
docker exec twitter-sync python main.py --test| 文档 | 说明 | |
|---|---|---|
| 🏗️ | 架构说明 | 数据流、SQLite Schema、状态机、游标机制 |
| 🍪 | Twitter Cookie 教程 | Cookie-Editor 导出步骤 |
| 🟡 | 币安 API 教程 | API Key 申请、接口说明、错误码 |
| 💬 | Discord Bot 教程 | Bot 创建和频道配置 |
| 🐳 | 部署教程 | Docker 安装和部署流程 |
| 🔧 | 故障排查 | 错误码对照、7 个常见场景 |
| ⚙️ | 自定义扩展 | 过滤规则、换平台、多账号 |