Skip to content
cccskills
FreePublished on GitHub

x-research

X (Twitter) のリアルタイム検索を行い、トピックに関するツイートを収集・分析する。検索結果を構造化レポート(Markdown + JSON + TXT)として出力。「Xで検索して」「Twitterで調べて」「ツイートを分析」等で発動。

The English summary is being prepared. Showing the original description.

See how to install

Files included (5)

  • SKILL.md6.1 KB
  • agents/openai.yaml178 B
  • scripts/x_research.py26.0 KB
  • SKILL.en.md5.5 KB
  • SKILL.es.md6.2 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

X Research - X (Twitter) リアルタイム検索・分析

Description

X API v2 Recent Search エンドポイントを使用して、指定トピックに関するリアルタイムのツイートを検索・収集・分析します。 取得したツイートをエンゲージメント順にランキングし、ハッシュタグ分析・時系列分布・共有URL一覧を含む構造化レポートを Markdown + JSON + プレーンテキストの3形式で出力します。

クイックスタート

# 基本的な検索
python skills/x-research/scripts/x_research.py --topic "生成AI"

# 英語で検索、リツイート除外
python skills/x-research/scripts/x_research.py --topic "Claude AI" --lang en --no-retweets

# 直近3日間、関連度順
python skills/x-research/scripts/x_research.py --topic "OpenAI" --days 3 --sort relevancy

Parameters

ParameterRequiredDefaultDescription
--topic, -tYes-検索トピック・キーワード
--query, -qNoautoカスタム検索クエリ(topicの代わりに直接指定)
--lang, -lNoja言語フィルタ: ja, en, all
--days, -dNo7検索期間(日数、最大7)
--sort, -sNorelevancyソート: relevancy, recency
--no-retweetsNofalseリツイートを除外
--no-repliesNofalseリプライを除外
--media-onlyNofalseメディア付きツイートのみ
--from-userNo-特定ユーザーのツイートのみ
--min-likesNo0最小いいね数(取得後フィルタ)
--max-results, -mNo501ページあたりの最大取得数(最大100)
--max-pagesNo3最大ページ数
--top-nNo10トップツイート表示数
--output, -oNooutput/x-research/出力ディレクトリ
--sessionNoautoセッション名(出力フォルダ名に使用)
--dry-runNofalseクエリを表示するだけで実行しない
--raw-jsonNofalse生APIレスポンスをstderrに出力

クエリ構文ガイド

--query で直接指定する場合、X API v2 の検索演算子が使えます:

演算子例説明
キーワード生成AI基本キーワード検索
"フレーズ""Claude Code"完全一致フレーズ
from:from:OpenAI特定ユーザーの投稿
to:to:username特定ユーザーへのメンション
-is:retweet-is:retweetリツイート除外
-is:reply-is:replyリプライ除外
has:mediahas:mediaメディア付きのみ
has:linkshas:linksリンク付きのみ
lang:lang:ja言語指定
#ハッシュタグ#AIハッシュタグ検索
ORAI OR 人工知能OR 検索
-keyword-広告キーワード除外

出力フォーマット

3つのファイルが output/x-research/YYYYMMDD_HHMMSS_{topic}/ に生成されます:

  1. {topic}_report.md - Markdown レポート

    • サマリー統計(ツイート数、ユニークユーザー数、いいね合計等)
    • トップツイート(エンゲージメント順)
    • ハッシュタグ分析
    • 時系列分布
    • 共有URL一覧
  2. {topic}_data.json - 構造化 JSON

    • メタデータ(クエリ、パラメータ、生成日時)
    • 統計情報
    • 全ツイートデータ(テキスト、メトリクス、著者情報)
  3. {topic}_raw.txt - プレーンテキスト要約

使用例

# 日本語で「生成AI」を検索(デフォルト設定)
python skills/x-research/scripts/x_research.py --topic "生成AI"

# 英語で「Claude」を検索、リツイート・リプライ除外
python skills/x-research/scripts/x_research.py \
  --topic "Claude AI" --lang en --no-retweets --no-replies

# 特定ユーザーの投稿を検索
python skills/x-research/scripts/x_research.py \
  --topic "AI" --from-user AnthropicAI --lang en

# メディア付きツイートのみ、直近3日間
python skills/x-research/scripts/x_research.py \
  --topic "AI art" --media-only --days 3 --lang en

# カスタムクエリで高度な検索
python skills/x-research/scripts/x_research.py \
  --query '"Claude Code" OR "Cursor AI" -is:retweet lang:en' --topic "AI IDE"

# dry-run でクエリを確認
python skills/x-research/scripts/x_research.py \
  --topic "テスト" --no-retweets --lang ja --dry-run

環境設定

必須: X Bearer Token

# .env に追加
X_BEARER_TOKEN=your_bearer_token_here

取得方法:

  1. X Developer Portal にアクセス
  2. プロジェクト/アプリを作成
  3. Bearer Token を取得
  4. .env ファイルに X_BEARER_TOKEN=... を追加

API制限

プラン検索上限期間
Free使用不可-
Basic ($100/月)60リクエスト/15分直近7日
Pro ($5,000/月)300リクエスト/15分直近7日

出力例

=== 出力完了 ===
  Markdown: output/x-research/20260210_053000_生成AI/生成AI_report.md
  JSON:     output/x-research/20260210_053000_生成AI/生成AI_data.json
  Text:     output/x-research/20260210_053000_生成AI/生成AI_raw.txt

--- サマリー ---
  ツイート数:     30
  ユニーク著者:   28
  いいね合計:     1,234
  リツイート合計: 56
  リプライ合計:   12
  期間:           2026-02-03 ~ 2026-02-10

依存関係

requests>=2.28.0
python-dotenv>=0.19.0

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

A/Bテストや実験の設計・実装を支援するスキル。 「A/Bテストを設計して」「スプリットテストしたい」「仮説を立ててテストしたい」「バリアントを比較」等のリクエストで発動。 トラッキング実装は analytics-tracking を参照。

The English summary is being prepared. Showing the original description.

minicoohei/ai-agent-camp346Updated Oct 7, 2026

マルチエージェントシステムのアーキテクチャ設計ツールキット。 「エージェントを設計して」「マルチエージェント構成」「エージェントのアーキテクチャ」「オーケストレーション設計」等のリクエストで発動。

The English summary is being prepared. Showing the original description.

minicoohei/ai-agent-camp346Updated Oct 7, 2026

ai-agent-campのローカル環境セットアップを確認するスキル。 「セットアップ確認」「環境チェック」「初期設定できてる?」「インストール確認」「依存関係チェック」等のリクエストで発動。

The English summary is being prepared. Showing the original description.

minicoohei/ai-agent-camp346Updated Oct 7, 2026

ai-agent-campのスラッシュコマンドをCodexでルーティングするスキル。 「/start-0-1を実行」「スラッシュコマンドを使いたい」「コマンドルーティング」「Cursorのコマンドを使いたい」等のリクエストで発動。

The English summary is being prepared. Showing the original description.

minicoohei/ai-agent-camp346Updated Oct 7, 2026

ai-agent-campの環境変数・認証情報を安全に管理するスキル。 「APIキーを設定」「.envを管理」「環境変数の設定」「credential managerを使いたい」「秘密情報の管理」等のリクエストで発動。

The English summary is being prepared. Showing the original description.

minicoohei/ai-agent-camp346Updated Oct 7, 2026

ai-agent-campリポジトリの案内・オリエンテーションスキル。 「リポジトリ案内」「次のレッスンは?」「どこから始める」「ツールの違い」「aiagent概要」等のリクエストで発動。

The English summary is being prepared. Showing the original description.

minicoohei/ai-agent-camp346Updated Oct 7, 2026

See all skills by minicoohei

Report a problem with this skill