Twitter Operations
{
"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 '来自OpenClaw的问候! #automation'"
},
{
"action": "post_thread",
"description": "发布推特线程",
"command": "openclaw twitter thread '线程第一部分' '线程第二部分' '线程第三部分'"
},
{
"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": "分析推特账户",
"command": "openclaw twitter analyze @username --metrics engagement,growth"
},
{
"action": "schedule_tweet",
"description": "定时发送推文",
"command": "openclaw twitter schedule '我的定时推文' --time '2026-02-03 10:00'"
},
{
"action": "auto_reply",
"description": "设置提及自动回复",
"command": "openclaw twitter auto-reply --keywords 'support,help' --message '感谢联系我们!'"
},
{
"action": "monitor_mentions",
"description": "实时监控品牌提及",
"command": "openclaw twitter monitor @brandname --alert-webhookhttps://hooks.example.com"},
{
"操作": "导出分析数据",
"描述": "导出推文分析数据",
"命令": "openclaw twitter analytics --days 30 --format csv --output ~/twitter_stats.csv"
},
{
"操作": "管理关注者",
"描述": "根据条件关注用户",
"命令": "openclaw twitter follow --search '#devops' --min-followers 100 --limit 20"
}
],
"错误处理": {
"超出速率限制": "等待并使用指数退避重试",
"认证失败": "检查配置文件中的凭据",
"无效推文": "发布前验证推文长度和媒体文件",
"网络错误": "增加超时时间后重试",
"API已弃用": "更新至最新API版本"
},
"最佳实践": [
"始终遵守Twitter的速率限制和服务条款",
"将API凭据安全存储在环境变量或加密文件中",
"实施适当的错误处理和日志记录",
"对重要事件使用Webhook通知",
"缓存频繁访问的数据以减少API调用",
"发布前验证推文内容",
"监控API使用情况以避免达到配额",
"对自动化操作实施渐进式启动",
"在批量操作间添加延迟以显得更人性化",
"定期备份重要推文数据和分析结果"
],
"安全措施": {
"凭据加密": true,
"API密钥轮换": "推荐",
"OAuth令牌刷新": "自动",
"敏感数据过滤": true,
"审计日志记录": true
}
}


微信扫一扫,打赏作者吧~