当前位置: 首页 > Skill >

X (Twitter)

X (Twitter)

X (Twitter)

起草、发布和管理 X(Twitter)帖子,检查时间线,管理个人资料,并通过 X API 自动执行社交媒体工作流程。在需要时使用此技能。

1.0.5 2026.11.25 553
获取Skill文件查看使用说明
作 者:叶川 许可证: 更新时间:2026.11.25
本文目录展开

X (Twitter)

Manage X (Twitter) — draft and publish posts, inspect timelines, search content, manage profiles, and automate social media workflows via the X API.

This skill uses ClawLink for hosted connection flows and credentials so you do not need to configure X API access yourself.

Setup in 3 Steps

Step 1: Install Step 2: Pair Account Step 3: Connect X (Twitter)
App-specific connection GIF coming soon
Run the install command in OpenClaw Sign in and approve the device Open the dashboard and connect X

How It Works

┌─────────────────┐     ┌──────────────┐     ┌──────────────────┐
│   OpenClaw      │────▶│   ClawLink   │────▶│    X API         │
│   (User Chat)   │     │   (OAuth)    │     │                  │
└─────────────────┘     └──────────────┘     └──────────────────┘
         │                       │                       │
         │  1. Install Plugin    │                       │
         │  2. Pair Device       │                       │
         │  3. Connect X         │                       │
         │                       │  4. Secure Token       │
         │                       │  5. Proxy Requests    │
         │                       │                       │
         ▼                       ▼                       ▼
   ┌──────────┐           ┌──────────┐           ┌──────────┐
   │  SKILL   │           │ Dashboard│           │    X     │
   │  File    │           │ Auth     │           │ Account  │
   └──────────┘           └──────────┘           └──────────┘

Install

Install the verified ClawLink plugin from ClawHub. After the user confirms, complete the full setup so ClawLink tools are visible in the next OpenClaw chat.

openclaw plugins install clawhub:clawlink-plugin
openclaw config set tools.alsoAllow '["clawlink-plugin"]' --strict-json
openclaw gateway restart

Then tell the user: "OpenClaw has been restarted. Send /new as a standalone message to start a fresh chat, then ask for X (Twitter) again."

Quick Start

# Get user profile
clawlink_call_tool --tool "twitter_get_user" --params '{"username": "username"}'

# Post a tweet
clawlink_call_tool --tool "twitter_create_tweet" --params '{"text": "Hello from OpenClaw!"}'

# search tweets
clawlink_call_tool --tool "twitter_search_tweets" --params '{"query": "openclaw"}'

Authentication

All X tool calls are authenticated automatically by ClawLink using the user's connected X account OAuth token.

No API token is required in chat. ClawLink stores the OAuth token securely and injects it into every X API request on the user's behalf.

Getting Connected

  1. Install the ClawLink plugin (see Install above).
  2. Pair the plugin with clawlink_begin_pairing if it is not configured yet.
  3. Open https://claw-link.dev/dashboard?add=twitter and connect X.
  4. Call clawlink_list_integrations to verify the connection is active.

Connection Management

List Connections

clawlink_list_integrations

Response: Returns all connected integrations. Look for twitter in the list.

Verify Connection

clawlink_list_tools --integration twitter

Response: Returns the live tool catalog for X.

Reconnect

If X tools are missing or the connection shows an error:

  1. Direct the user to https://claw-link.dev/dashboard?add=twitter
  2. After they confirm, call clawlink_list_integrations to verify
  3. Then call clawlink_list_tools --integration twitter

Security & Permissions

  • Access is scoped to the X account connected during OAuth setup and the permissions granted.
  • All write operations (post tweet, delete, retweet, like, follow) require explicit user confirmation.
  • Posts are public-facing by default — always confirm the content before posting.
  • Account deletion or suspension-related operations are high-impact and must be confirmed.
  • Rate limits apply to many endpoints — honor backoff guidance.

Tool Reference

Tweets (Posts)

Tool Description Mode
twitter_list_tweets List tweets from a user's timeline Read
twitter_get_tweet Get a specific tweet's details Read
twitter_create_tweet Post a new tweet Write
twitter_delete_tweet Delete a tweet Write
twitter_update_tweet Update a tweet's text Write
twitter_retweet Retweet an existing tweet Write
twitter_unretweet Remove a retweet Write
twitter_like_tweet Like a tweet Write
twitter_unlike_tweet Remove a like from a tweet Write

Timelines

Tool Description Mode
twitter_get_home_timeline Get tweets from the home timeline Read
twitter_get_user_timeline Get tweets from a specific user's timeline Read
twitter_get_mentions_timeline Get tweets mentioning the authenticated user Read

Search

Tool Description Mode
twitter_search_tweets Search for tweets matching a query Read
twitter_search_users Search for users matching a query Read

Users & Profiles

Tool Description Mode
twitter_get_user Get a user's profile information Read
twitter_list_followers List followers of a user Read
twitter_list_following List accounts a user follows Read
twitter_follow_user Follow a user Write
twitter_unfollow_user Unfollow a user Write
twitter_block_user Block a user Write
twitter_unblock_user Unblock a user Write
twitter_mute_user Mute a user Write
twitter_unmute_user Unmute a user Write

Bookmarks

Tool Description Mode
twitter_list_bookmarks List the authenticated user's bookmarks Read
twitter_add_bookmark Add a tweet to bookmarks Write
twitter_remove_bookmark Remove a tweet from bookmarks Write

Lists

Tool Description Mode
twitter_list_list_memberships List lists a user is a member of Read
twitter_list_list_subscribers List subscribers to a list Read
twitter_list_list_tweets Get tweets from a specific list Read

Direct Messages

Tool Description Mode
twitter_list_direct_messages List direct messages Read
twitter_send_direct_message Send a direct message Write

Media

Tool Description Mode
twitter_upload_media Upload an image or video to attach to a tweet Write
twitter_create_tweet_with_media Post a tweet with attached media Write

Code Examples

Post a tweet

clawlink_call_tool --tool "twitter_create_tweet" 
  --params '{
    "text": "Excited to announce our new integration! Check it out at https://example.com"
  }'

Get a user profile

clawlink_call_tool --tool "twitter_get_user" 
  --params '{
    "username": "elonmusk"
  }'

Search for tweets

clawlink_call_tool --tool "twitter_search_tweets" 
  --params '{
    "query": "openclaw ai assistant",
    "max_results": 10
  }'

Retweet a post

clawlink_call_tool --tool "twitter_retweet" 
  --params '{
    "tweet_id": "TWEET_ID"
  }'

Follow a user

clawlink_call_tool --tool "twitter_follow_user" 
  --params '{
    "username": "example_user"
  }'

Upload media and post

clawlink_call_tool --tool "twitter_create_tweet_with_media" 
  --params '{
    "text": "Check out this screenshot!",
    "media_ids": ["MEDIA_ID"]
  }'

Discovery Workflow

  1. Call clawlink_list_integrations to confirm X is connected.
  2. Call clawlink_list_tools --integration twitter to see the live catalog.
  3. Treat the returned list as the source of truth. Do not guess or assume what tools exist.
  4. If the user describes a capability but the exact tool is unclear, call clawlink_search_tools with a short query and integration twitter.
  5. If no X tools appear, direct the user to https://claw-link.dev/dashboard?add=twitter.

Execution Workflow

┌─────────────────────────────────────────────────────────────┐
│  READ OPERATIONS (Safe)                                     │
│  list → get → search → describe                            │
│                                                             │
│  Example: Get user → List tweets → Show profile            │
└─────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────┐
│  WRITE OPERATIONS (Require Confirmation)                    │
│  describe → preview → confirm → call                        │
│                                                             │
│  Example: Preview tweet → User approves → Post tweet        │
└─────────────────────────────────────────────────────────────┘
  1. For unfamiliar tools, ambiguous requests, or any write action, call clawlink_describe_tool first.
  2. Use the returned guidance, schema, whenToUse, askBefore, safeDefaults, examples, and followups to shape the call.
  3. Prefer read, list, get, and search operations before writes when that reduces ambiguity.
  4. For writes or anything marked as requiring confirmation, call clawlink_preview_tool first.
  5. Execute with clawlink_call_tool. Pass confirmation only after the preview matches the user's intent.
  6. If the tool call fails, report the real error. Do not invent results or restate the failure as a missing capability unless the live catalog supports that conclusion.

Notes

  • Tweet IDs are numeric and very large — handle them as strings to avoid precision loss.
  • Rate limits vary by endpoint and account type — Basic/Free accounts have stricter limits.
  • Media uploads must complete before being attached to a tweet — use the returned media ID.
  • Deleted tweets cannot be recovered.
  • Direct messages have separate rate limits and scope restrictions.
  • X API v2 is used — some v1 endpoints may not be available.

Error Handling

Status / Error Meaning
Tool not found The tool name does not exist in the current catalog. Verify with clawlink_list_tools --integration twitter.
Missing connection X is not connected. Direct the user to https://claw-link.dev/dashboard?add=twitter.
Tweet not found The tweet ID does not exist or has been deleted.
User not found The username does not match any account.
Unauthorized The OAuth token lacks permission for this operation.
Duplicate The tweet text is identical to a recent tweet (spam protection).
Rate limit exceeded Too many requests. Wait and retry with backoff.
Media upload failed The file format is unsupported or exceeds size limits.
Write rejected User did not confirm a write action. Always confirm before executing writes.

Troubleshooting: Tools Not Visible

  1. Check that the ClawLink plugin is installed:
    openclaw plugins list
    
  2. If the plugin is installed but tools are missing, tell the user to send /new as a standalone message to reload the catalog.
  3. If a fresh chat does not help, run:
    openclaw config set tools.alsoAllow '["clawlink-plugin"]' --strict-json
    openclaw gateway restart
    
  4. After restart, tell the user to send /new again and retry.

Troubleshooting: Post Fails

  1. Verify the account has posting permissions — some enterprise accounts restrict API posting.
  2. Check for duplicate content — X prevents posting identical tweets in quick succession.
  3. Confirm media formats and sizes are within X's limits.
  4. Check rate limits — free accounts have significantly reduced posting limits.

Resources

  • X API Documentation
  • X API Reference
  • X Developer Portal
  • ClawLink: https://claw-link.dev
  • ClawLink Docs: https://docs.claw-link.dev/openclaw
  • ClawLink Verification: https://claw-link.dev/verify

Powered by ClawLink — an integration hub for OpenClaw

ClawLink Logo

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,014
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,014
Skill 文件
  • SKILL.md
    • X (Twitter)
      • Setup in 3 Steps
    • How It Works
    • Install
    • Quick Start
    • Authentication
      • Getting Connected
    • Connection Management
      • List Connections
      • Verify Connection
      • Reconnect
    • Security & Permissions
    • Tool Reference
      • Tweets (Posts)
      • Timelines
      • Search
      • Users & Profiles
      • Bookmarks
      • Lists
      • Direct Messages
      • Media
    • Code Examples
      • Post a tweet
      • Get a user profile
      • Search for tweets
      • Retweet a post
      • Follow a user
      • Upload media and post
    • Discovery Workflow
    • Execution Workflow
    • Notes
    • Error Handling
      • Troubleshooting: Tools Not Visible
      • Troubleshooting: Post Fails
    • Resources
  • 项目或源文件

相关 Skill

更多
X Tweet By Conversation X Tweet By Conversation Collects every tweet in an X (Twitter) conversation thread given a conversation id (root tweet id) — the focal tweet plus all replies, sub-replies, and quote chains — and returns normalized per-tweet data with text, author, engagement counts, media, hashtags, mentions, in_reply_to mapping, and curso
Fxtwitter Extract Fxtwitter Extract 使用 FxTwitter API 提取 X (Twitter) 文章内容。支持提取推文、线程、用户资料,包括文本、图片、视频、投票等。无需 API Key。
X Analytics CLI X Analytics CLI 通过 x-analytics-cli 进行 X (Twitter) 数据分析与获取。适用于用户搜索推文、统计推文数量、查询用户资料、获取推文详情。
xAI Grok Search xAI Grok Search 使用 xAI Grok API 搜索网页和 X (Twitter),支持实时访问、引用和图像理解。
AI Trend Hunter Pro AI Trend Hunter Pro A high-performance automation agent that turns global trends into viral social media posts for X (Twitter), Xiaohongshu, and LinkedIn — built on the exact sc...