详情

首页手游攻略 twitter-openclaw:自动化 X 和 Twitter 工作流 - Openclaw 技能库

twitter-openclaw:自动化 X 和 Twitter 工作流 - Openclaw 技能库

佚名 2026-08-08 09:25:02

什么是 twitter-openclaw?

twitter-openclaw 是一款专门设计的集成工具,旨在赋予 AI 智能体访问 Twitter/X 生态系统的完整权限。通过利用 twclaw 命令行工具,该技能允许智能体执行复杂的社交媒体操作,从通过搜索进行情绪分析到通过点赞和转发进行积极的社区互动。作为 Openclaw 技能生态系统的核心组件,它提供了一种结构化方式来弥合大语言模型(LLM)与实时社交数据之间的差距。

该工具专为需要自动化社交媒体监控或内容分发且无需人工干预的开发者构建。它处理了 Twitter API 的复杂性,包括分页和身份验证,提供了一个完美契合自动化 AI 工作流的简洁接口。将此工具集成到您的 Openclaw 技能集合中,可确保您的智能体紧跟全球对话的脉搏。

下载入口:https://github.com/openclaw/skills/tree/main/skills/annettemekuro30/x-twitter

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install x-twitter

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 <project>/skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 x-twitter。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

twitter-openclaw 应用场景

  • 通过搜索特定关键词或提及来自动化品牌监控。
  • 总结长信息流,用于研究和知识管理。
  • 调度并发布自动化更新或富媒体公告。
  • 追踪特定地理区域的热门话题,进行市场分析。
  • 通过点赞或回复相关的用户互动来管理社区参与度。
twitter-openclaw 工作原理
  1. 该技能使用 Bearer Token 以及用于写入权限的可选 API 密钥对 Twitter API 进行身份验证。
  2. AI 智能体根据用户请求调用特定的 twclaw 命令(例如搜索、阅读或发布)。
  3. 该工具从 Twitter/X 获取数据,并将其格式化为人类可读的文本或机器可读的 JSON。
  4. 对于发布推文或转发等互动操作,该技能遵循安全协议,在执行前确认操作。
  5. 结果返回给智能体,由其进行总结、分析或呈现给用户。

twitter-openclaw 配置指南

要开始使用此技能,请安装 twclaw 软件包并配置环境变量:

npm install -g twclaw
export TWITTER_BEARER_TOKEN='your_bearer_token'
# 可选:用于写入权限
export TWITTER_API_KEY='your_key'
export TWITTER_API_SECRET='your_secret'
twclaw auth-check

twitter-openclaw 数据架构与分类体系

该技能组织从 Twitter/X 检索到的数据,以确保 AI 智能体能够有效地解析和展示。下表描述了标准元数据结构:

属性 描述
作者/句柄 发布内容的用户的标识符
内容 推文的全文,包括线索上下文
互动 点赞、转发和回复的实时计数
时间戳 用于时间线和线索排序的时间数据
JSON Schema 可通过 --json 标志获取完整的原始元数据,用于程序化处理
name: twitter-openclaw
description: Interact with Twitter/X — read tweets, search, post, like, retweet, and manage your timeline.
user-invocable: true
metadata: {"openclaw":{"emoji":"????","skillKey":"twitter-openclaw","primaryEnv":"TWITTER_BEARER_TOKEN","requires":{"bins":["twclaw"],"env":["TWITTER_BEARER_TOKEN"]},"install":[{"id":"npm","kind":"node","package":"twclaw","bins":["twclaw"],"label":"Install twclaw (npm)"}]}}

twitter-openclaw ????

Interact with Twitter/X posts, timelines, and users from OpenClaw.

Authentication

Requires a Twitter API Bearer Token set as TWITTER_BEARER_TOKEN.

Optionally set TWITTER_API_KEY and TWITTER_API_SECRET for write operations (post, like, retweet).

Run twclaw auth-check to verify credentials.

Commands

Reading

twclaw read <tweet-url-or-id>          # Read a single tweet with full metadata
twclaw thread <tweet-url-or-id>        # Read full conversation thread
twclaw replies <tweet-url-or-id> -n 20 # List replies to a tweet
twclaw user <@handle>                  # Show user profile info
twclaw user-tweets <@handle> -n 20     # User's recent tweets

Timelines

twclaw home -n 20                      # Home timeline
twclaw mentions -n 10                  # Your mentions
twclaw likes <@handle> -n 10           # User's liked tweets
twclaw search "query" -n 10            # Search tweets
twclaw search "from:elonmusk AI" -n 5  # Search with operators
twclaw search "#trending" --recent     # Recent tweets only
twclaw search "query" --popular        # Popular tweets only
twclaw trending                        # Trending topics worldwide
twclaw trending --woeid 23424977       # Trending in specific location

Posting

twclaw tweet "hello world"                          # Post a tweet
twclaw reply <tweet-url-or-id> "great thread!"      # Reply to a tweet
twclaw quote <tweet-url-or-id> "interesting take"   # Quote tweet
twclaw tweet "look at this" --media image.png        # Tweet with media

Engagement

twclaw like <tweet-url-or-id>          # Like a tweet
twclaw unlike <tweet-url-or-id>        # Unlike a tweet
twclaw retweet <tweet-url-or-id>       # Retweet
twclaw unretweet <tweet-url-or-id>     # Undo retweet
twclaw bookmark <tweet-url-or-id>      # Bookmark a tweet
twclaw unbookmark <tweet-url-or-id>    # Remove bookmark

Following

twclaw follow <@handle>                # Follow user
twclaw unfollow <@handle>              # Unfollow user
twclaw followers <@handle> -n 20       # List followers
twclaw following <@handle> -n 20       # List following

Lists

twclaw lists                           # Your lists
twclaw list-timeline <list-id> -n 20   # Tweets from a list
twclaw list-add <list-id> <@handle>    # Add user to list
twclaw list-remove <list-id> <@handle> # Remove user from list

Output Options

--json          # JSON output
--plain         # Plain text, no formatting
--no-color      # Disable ANSI colors
-n <count>      # Number of results (default: 10)
--cursor <val>  # Pagination cursor for next page
--all           # Fetch all pages (use with caution)

Guidelines for OpenClaw

  • When reading tweets, always show: author, handle, text, timestamp, engagement counts.
  • For threads, present tweets in chronological order.
  • When searching, summarize results concisely with key metrics.
  • Before posting/liking/retweeting, confirm the action with the user.
  • Rate limits apply — space out bulk operations.
  • Use --json when you need to process output programmatically.

Troubleshooting

401 Unauthorized

Check that TWITTER_BEARER_TOKEN is set and valid.

429 Rate Limited

Wait and retry. Twitter API has strict rate limits per 15-minute window.


TL;DR: Read, search, post, and engage on Twitter/X. Always confirm before write actions.

相关资讯
点击查看更多
游戏推荐
推荐专题
热门阅读
推荐下载