interacting-with-x

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Interacting with X

与X(Twitter)交互

Enables agents to operate on X (Twitter) with full interaction capabilities.
允许Agent在X(Twitter)上进行完整的交互操作。

Setup

设置

Add to
.env
:
X_API_KEY=your_api_key
X_API_SECRET=your_api_secret
X_ACCESS_TOKEN=your_access_token
X_ACCESS_TOKEN_SECRET=your_access_token_secret
X_BEARER_TOKEN=your_bearer_token
添加到.env文件中:
X_API_KEY=your_api_key
X_API_SECRET=your_api_secret
X_ACCESS_TOKEN=your_access_token
X_ACCESS_TOKEN_SECRET=your_access_token_secret
X_BEARER_TOKEN=your_bearer_token

Operations

操作

Post a Tweet

发布推文

bash
undefined
bash
undefined

Simple tweet

简单推文

uv run python .skills/interacting-with-x/scripts/post.py "Hello from Central"
uv run python .skills/interacting-with-x/scripts/post.py "Hello from Central"

Thread (multiple tweets chained)

推文线程(多条推文串联)

uv run python .skills/interacting-with-x/scripts/post.py --thread "First tweet" "Second tweet" "Third tweet"
uv run python .skills/interacting-with-x/scripts/post.py --thread "First tweet" "Second tweet" "Third tweet"

With media

附带媒体

uv run python .skills/interacting-with-x/scripts/post.py --media image.png "Tweet with image"
uv run python .skills/interacting-with-x/scripts/post.py --media image.png "Tweet with image"

Reply to existing tweet

回复现有推文

uv run python .skills/interacting-with-x/scripts/post.py --reply-to 1234567890 "Reply text"
undefined
uv run python .skills/interacting-with-x/scripts/post.py --reply-to 1234567890 "Reply text"
undefined

Read Timeline/Mentions

阅读时间线/提及

bash
undefined
bash
undefined

Home timeline

首页时间线

uv run python .skills/interacting-with-x/scripts/read.py timeline
uv run python .skills/interacting-with-x/scripts/read.py timeline

Mentions

提及我的推文

uv run python .skills/interacting-with-x/scripts/read.py mentions
uv run python .skills/interacting-with-x/scripts/read.py mentions

User's tweets

用户推文

uv run python .skills/interacting-with-x/scripts/read.py user elonmusk
uv run python .skills/interacting-with-x/scripts/read.py user elonmusk

Search

搜索

uv run python .skills/interacting-with-x/scripts/read.py search "AI agents"
undefined
uv run python .skills/interacting-with-x/scripts/read.py search "AI agents"
undefined

Engage

互动操作

bash
undefined
bash
undefined

Like

点赞

uv run python .skills/interacting-with-x/scripts/engage.py like 1234567890
uv run python .skills/interacting-with-x/scripts/engage.py like 1234567890

Retweet

转发

uv run python .skills/interacting-with-x/scripts/engage.py retweet 1234567890
uv run python .skills/interacting-with-x/scripts/engage.py retweet 1234567890

Follow/unfollow

关注/取消关注

uv run python .skills/interacting-with-x/scripts/engage.py follow username uv run python .skills/interacting-with-x/scripts/engage.py unfollow username
undefined
uv run python .skills/interacting-with-x/scripts/engage.py follow username uv run python .skills/interacting-with-x/scripts/engage.py unfollow username
undefined

Rate Limits

速率限制

X API has strict rate limits. Pro tier helps but still:
  • Posts: 100/24h (Pro: 500/24h)
  • Reads: 100 requests/15min
  • Likes: 50/24h
Scripts handle rate limiting automatically. See
references/api-reference.md
for details.
X API有严格的速率限制。Pro套餐可缓解限制,但仍需注意:
  • 发布:100条/24小时(Pro:500条/24小时)
  • 读取:100次请求/15分钟
  • 点赞:50次/24小时
脚本会自动处理速率限制。详情请参阅
references/api-reference.md

Character Limits

字符限制

  • Standard: 280 characters
  • Pro: 25,000 characters
Scripts auto-detect account type and handle accordingly.
  • 标准账户:280字符
  • Pro账户:25,000字符
脚本会自动检测账户类型并进行相应处理。

Cross-posting from ATProto

从ATProtocol交叉发布

For mirroring Bluesky content to X:
python
undefined
如需将Bluesky内容镜像到X:
python
undefined

In your code

在你的代码中

from .skills.interacting_with_x.scripts import post
from .skills.interacting_with_x.scripts import post

After posting to Bluesky, cross-post to X

发布到Bluesky后,交叉发布到X

post.create_tweet(text) # or post.create_thread(texts) for threads

Facets (mentions, links) are automatically converted to X format.
post.create_tweet(text) # 若为线程推文则使用post.create_thread(texts)

Facets(提及、链接)会自动转换为X的格式。