{
"name": "twitter_operations",
"description": "全面的 Twitter/X 平台自动化与管理工具",
"version": "1.0.0",
"category": "social_media",
"enabled": true,
"triggers": ["twitter", "tweet", "x.com", "social media", "twitter api"],
"capabilities": [
"发布推文和推文串",
"在最佳互动时间安排推文",
"回复提及和私信",
"按关键词、话题标签或用户搜索推文",
"监控热门话题和标签",
"分析推文表现和互动指标",
"根据条件关注/取消关注用户",
"点赞和转推内容",
"创建和管理 Twitter 列表",
"追踪粉丝增长和分析数据",
"实现 Twitter 机器人功能",
"抓取推文和用户资料",
"生成带优化话题标签的推文内容",
"管理多个 Twitter 账户",
"监控品牌提及和情感倾向",
"自动回复特定关键词或模式",
"归档推文和用户数据",
"创建 Twitter 投票",
"上传和管理媒体(图片、视频、GIF)",
"实现速率限制和 API 配额管理",
"处理 Twitter 认证(OAuth 1.0a/2.0)",
"解析和格式化推文元数据",
"将分析数据导出为 CSV/JSON",
"实时流式接收推文",
"检测并响应特定用户互动",
"批量操作(批量关注/取消关注/屏蔽)",
"Twitter Spaces 监控与参与",
"社区管理与内容审核",
"话题标签表现追踪",
"竞争对手账户监控"
],
"parameters": {
"api_version": "v2",
"auth_type": "oauth2",
"rate_limit_mode": "conservative",
"max_tweets_per_request": 100,
"default_tweet_count": 10,
"retry_attempts": 3,
"timeout_seconds": 30,
"media_upload_max_size_mb": 5,
"thread_delay_seconds": 2,
"auto_hashtag_limit": 5,
"sentiment_analysis": true,
"enable_streaming": false,
"archive_tweets": true
},
"dependencies": [
"tweepy>=4.14.0",
"python-twitter-v2>=0.9.0",
"requests>=2.31.0",
"requests-oauthlib>=1.3.1",
"python-dotenv>=1.0.0",
"pandas>=2.0.0",
"beautifulsoup4>=4.12.0",
"schedule>=1.2.0",
"textblob>=0.17.1",
"Pillow>=10.0.0"
],
"configuration": {
"credentials_file": "~/.openclaw/twitter_credentials.json",
"cache_dir": "~/.openclaw/cache/twitter",
"log_file": "~/.openclaw/logs/twitter.log",
"archive_dir": "~/.openclaw/archives/twitter"
},
"api_endpoints": {
"tweet": "/2/tweets",
"search": "/2/tweets/search/recent",
"users": "/2/users",
"timeline": "/2/users/:id/tweets",
"likes": "/2/users/:id/likes",
"retweets": "/2/tweets/:id/retweets",
"followers": "/2/users/:id/followers",
"following": "/2/users/:id/following",
"spaces": "/2/spaces",
"lists": "/2/lists",
"media": "/1.1/media/upload"
},
"examples": [
{
"action": "post_tweet",
"description": "发布一条简单推文",
"command": "openclaw twitter post 'Hello from OpenClaw! #automation'"
},
{
"action": "post_thread",
"description": "发布一个推文串",
"command": "openclaw twitter thread 'Thread part 1' 'Thread part 2' 'Thread part 3'"
},
{
"action": "search_tweets",
"description": "搜索近期推文",
"command": "openclaw twitter search '#AI OR #MachineLearning' --count 50"
},
{
"action": "get_trends",
"description": "获取热门话题",
"command": "openclaw twitter trends --location 'United States'"
},
{
"action": "analyze_account",
"description": "分析 Twitter 账户",
"command": "openclaw twitter analyze @username --metrics engagement,growth"
},
{
"action": "schedule_tweet",
"description": "安排稍后发布的推文",
"command": "openclaw twitter schedule 'My scheduled tweet' --time '2026-02-03 10:00'"
},
{
"action": "auto_reply",
"description": "设置提及自动回复",
"command": "openclaw twitter auto-reply --keywords 'support,help' --message 'Thanks for reaching out!'"
},
{
"action": "monitor_mentions",
"description": "实时监控品牌提及",
"command": "openclaw twitter monitor @brandname --alert-webhook https://hooks.example.com"
},
{
"action": "export_analytics",
"description": "导出推文分析数据",
"command": "openclaw twitter analytics --days 30 --format csv --output ~/twitter_stats.csv"
},
{
"action": "manage_followers",
"description": "根据条件关注用户",
"command": "openclaw twitter follow --search '#devops' --min-followers 100 --limit 20"
}
],
"error_handling": {
"rate_limit_exceeded": "等待并使用指数退避策略重试",
"authentication_failed": "检查配置文件中的凭据",
"invalid_tweet": "发布前验证推文长度和媒体",
"network_error": "增加超时时间后重试",
"api_deprecated": "更新至最新 API 版本"
},
"best_practices": [
"始终遵守 Twitter 的速率限制和服务条款",
"将 API 凭据安全存储在环境变量或加密文件中",
"实施适当的错误处理和日志记录",
"对重要事件使用 Webhook 通知",
"缓存频繁访问的数据以减少 API 调用",
"发布前验证推文内容",
"监控 API 使用情况以避免超出配额",
"对自动化操作实施渐进式启动",
"在批量操作之间添加延迟,使其更接近人类行为",
"定期备份重要推文数据和分析结果"
],
"security": {
"credential_encryption": true,
"api_key_rotation": "recommended",
"oauth_token_refresh": "automatic",
"sensitive_data_filtering": true,
"audit_logging": true
}
}