mcpField
S
storyclaw-x-manager

storyclaw-x-manager

github.com/storyclaw-official营销与增长046 次安装今天更新
代码仓库

关于 storyclaw-x-manager

storyclaw-x-manager 是用于管理 X 账号的技能,涵盖发帖、互动、时间线、搜索和分析。它支持按用户保存凭据,并可按关键词配置自动回复。

主要功能

  1. 01发布并拆分长帖
  2. 02点赞、回复和转发
  3. 03读取用户帖子与时间线
  4. 04搜索帖子
  5. 05配置关键词自动回复

适用场景

  1. 01向 X 账号发布动态
  2. 02查看账号时间线或搜索帖子
  3. 03自动回复匹配关键词的内容

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/storyclaw-official/talenthub --skill storyclaw-x-manager

安装后在 Claude Code 中输入/storyclaw-x-manager确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

.gitignore
credentials/
example.json
scripts/
get_timeline.py
get_user_tweets.py
like_tweet.py
post_tweet.py
reply_tweet.py
retweet.py
search_tweets.py

详细介绍

X 管理器 - Twitter/X 账号管理

管理 X(原 Twitter)账号:发布内容、互动、时间线和分析。

多用户架构

每位用户的凭据存储在 credentials/{USER_ID}.json 中:

{
  "twitter": {
    "api_key": "",
    "api_secret": "",
    "access_token": "",
    "access_token_secret": "",
    "bearer_token": ""
  }
}

如果用户尚未配置 Twitter 凭据,请先提示其绑定 X 账号。

或者设置环境变量:TWITTER_API_KEY、TWITTER_API_SECRET、TWITTER_ACCESS_TOKEN、TWITTER_ACCESS_TOKEN_SECRET、TWITTER_BEARER_TOKEN。

支持的操作

1. 发布推文
python3 {baseDir}/scripts/post_tweet.py <USER_ID> "<tweet content>" [--media <image_path>]

最多 280 个字符。对于 Premium/Enterprise 账号,较长的推文会自动拆分。

2. 互动

点赞:

python3 {baseDir}/scripts/like_tweet.py <USER_ID> <tweet_id>

回复:

python3 {baseDir}/scripts/reply_tweet.py <USER_ID> <tweet_id> "<reply content>"

转推:

python3 {baseDir}/scripts/retweet.py <USER_ID> <tweet_id>
3. 数据检索

用户推文:

python3 {baseDir}/scripts/get_user_tweets.py <USER_ID> <twitter_handle> [--count <n>]

时间线:

python3 {baseDir}/scripts/get_timeline.py <USER_ID> [--count <n>]

搜索:

python3 {baseDir}/scripts/search_tweets.py <USER_ID> "<keywords>" [--count <n>]

自动互动工作流

在 state/{USER_ID}.json 中配置:

{
  "auto_reply": {
    "enabled": true,
    "keywords": ["keyword1", "keyword2"],
    "reply_template": "Thanks {username} for {keyword}!"
  }
}

错误处理

  • API 速率限制:提示用户等待后重试
  • 身份验证失败:提示用户重新绑定 X 账号
  • 推文过长:自动拆分或提示用户缩短内容

Twitter API 套餐

  • Free:仅限读取,不能发布
  • Premium($100/月):发布 + 分析
  • Enterprise:更高的限制

评论

支持 Markdown