mcpField
T
twitter

twitter

github.com/resciencelab其他1.9k2.1k 次安装1 天前更新
代码仓库

关于 twitter

twitter 是通过 twitterapi.io 获取 Twitter/X 数据的命令行技能,适用于处理社交数据的用户和 Agent。脚本覆盖用户、推文、列表、社群、Spaces 和趋势。

主要功能

  1. 01获取用户资料与动态
  2. 02搜索和读取推文及回复
  3. 03查看关注者、关注对象和列表
  4. 04获取社群与 Space 数据
  5. 05查看全球趋势

适用场景

  1. 01查看账号的推文和提及
  2. 02使用查询语法搜索推文
  3. 03检查社群成员与帖子
  4. 04查看趋势和 Twitter Spaces

安装

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

$npx skills add https://github.com/resciencelab/opc-skills --skill twitter

安装后在 Claude Code 中输入/twitter确认已加载。

包含的文件

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

.claude-plugin/
plugin.json
scripts/
batch_get_users.py
check_relationship.py
credential.py
get_article.py
get_community_members.py
get_community_moderators.py
get_community_tweets.py
get_community.py
get_followers.py
get_following.py
get_list_followers.py
get_list_members.py
get_space.py
get_trends.py
get_tweet_quotes.py
get_tweet_replies.py
get_tweet_retweeters.py
get_tweet_thread.py
get_tweet.py
get_user_about.py
get_user_info.py
get_user_mentions.py
get_user_tweets.py
get_verified_followers.py
search_community_tweets.py
search_tweets.py
search_users.py
twitter_api.py

详细介绍

Twitter/X 技能

通过 twitterapi.io 获取用户资料、推文、回复、关注者/关注列表、社群、Spaces 和趋势。

先决条件

在 ~/.zshrc 中设置 API 密钥:

export TWITTERAPI_API_KEY="your_api_key"

快速检查:

cd <skill_directory>
python3 scripts/get_user_info.py elonmusk

命令

所有命令均在技能目录中运行。

用户端点
python3 scripts/get_user_info.py USERNAME
python3 scripts/get_user_about.py USERNAME
python3 scripts/batch_get_users.py USER_ID1,USER_ID2
python3 scripts/get_user_tweets.py USERNAME --limit 20
python3 scripts/get_user_mentions.py USERNAME --limit 20
python3 scripts/get_followers.py USERNAME --limit 100
python3 scripts/get_following.py USERNAME --limit 100
python3 scripts/get_verified_followers.py USERNAME --limit 20
python3 scripts/check_relationship.py USER1 USER2
python3 scripts/search_users.py "query" --limit 20
推文端点
python3 scripts/get_tweet.py TWEET_ID [TWEET_ID2...]
python3 scripts/search_tweets.py "query" --type Latest --limit 20
python3 scripts/get_tweet_replies.py TWEET_ID --limit 20
python3 scripts/get_tweet_quotes.py TWEET_ID --limit 20
python3 scripts/get_tweet_retweeters.py TWEET_ID --limit 50
python3 scripts/get_tweet_thread.py TWEET_ID
python3 scripts/get_article.py TWEET_ID
列表端点
python3 scripts/get_list_followers.py LIST_ID --limit 20
python3 scripts/get_list_members.py LIST_ID --limit 20
社群端点
python3 scripts/get_community.py COMMUNITY_ID
python3 scripts/get_community_members.py COMMUNITY_ID --limit 20
python3 scripts/get_community_moderators.py COMMUNITY_ID
python3 scripts/get_community_tweets.py COMMUNITY_ID --limit 20
python3 scripts/search_community_tweets.py "query" --limit 20
其他端点
python3 scripts/get_space.py SPACE_ID
python3 scripts/get_trends.py --woeid 1  # Worldwide

搜索查询语法

# Basic search
python3 scripts/search_tweets.py "AI agent"

# From specific user
python3 scripts/search_tweets.py "from:elonmusk"

# Date range
python3 scripts/search_tweets.py "AI since:2024-01-01 until:2024-12-31"

# Exclude retweets
python3 scripts/search_tweets.py "AI -filter:retweets"

# With media
python3 scripts/search_tweets.py "AI filter:media"

# Minimum engagement
python3 scripts/search_tweets.py "AI min_faves:1000"

API:twitterapi.io

评论

支持 Markdown