x-search

Search X (Twitter) for account posts, trending topics, or topic discussions using Grok API. Outputs Obsidian-ready Markdown.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "x-search" with this command: npx skills add wangyue55/x-search-grok

X Search

Search X (Twitter) via Grok API. Outputs Obsidian-ready Markdown.

Prerequisites

Ensure XAI_API_KEY is set:

export XAI_API_KEY=your_key_here

Get your API key at x.ai/api (xAI developer console).

Default model is grok-4-1-fast-reasoning. To override:

export XAI_MODEL=grok-4

Install dependency if needed:

pip install requests

Invocation

Slash Command

/x-search account @elonmusk --time 24h
/x-search account @user1 @user2 --time 48h
/x-search account @sama --count 10
/x-search --lang en account @elonmusk --count 5
/x-search trends "#AI" "#LLM"
/x-search --lang en trends "#AI" "#crypto"
/x-search topic "Claude MCP"
/x-search --lang ja topic "AI規制"

--lang controls the language of summaries, keyword explanations, and translations (default: zh). When --lang en, the translation field is omitted since the original is already in English.

--output saves the result to a Markdown file (stdout is preserved):

  • Pass a directory → auto-named file: karpathy-2026-03-22.md, trends-AI-2026-03-22.md, etc.
  • Pass a full path → saved directly to that path
  • Same-day runs overwrite the existing file (no duplicate accumulation)

--progress-only suppresses full Markdown on stdout — prints one summary line instead. Use with --output in automated pipelines (watchlist, cron) to avoid injecting large outputs into the agent context.

Natural Language

  • "Search X for @elonmusk's posts in the last 24 hours"
  • "X上搜索@sama和@elonmusk最新的10条推文"
  • "Find trending posts about #AI on X in English"
  • "X上关于Claude MCP的热点讨论"

How to Run

Find the script at ~/.claude/skills/x-search/x_search.py (or the symlinked path).

# Account mode — by time range
python3 ~/.claude/skills/x-search/x_search.py account @elonmusk --time 24h

# Account mode — by post count
python3 ~/.claude/skills/x-search/x_search.py account @user1 @user2 --count 10

# Trends mode — top 10 posts per trend
python3 ~/.claude/skills/x-search/x_search.py trends "#AI" "#LLM"

# Topic mode — hot discussions
python3 ~/.claude/skills/x-search/x_search.py topic "Claude MCP"

Output

Results are printed as Obsidian-ready Markdown.

Context efficiency: When results are large (multiple accounts, long time ranges) or when --output is provided, save to file and show only a brief summary to the user (e.g., "Found 12 posts from @karpathy, saved to ~/obsidian/X/karpathy-2026-03-22.md"). Only present the full content inline when the result is short or the user explicitly asks to see it.

For account mode, after showing results (or summary) ask:

"是否保存到文件?(例如:~/obsidian/X/@elonmusk-2026-03-22.md)"

If the user provides a path, run again with --output <path>.

Watchlist

Run all your monitored accounts, trends, and topics in one command via watchlist.py.

Setup

Copy the sample config and edit it:

cp ~/.claude/skills/x-search/watchlist.yaml ~/.x-search.yaml
# ~/.x-search.yaml
accounts:
  - "@karpathy"
  - "@elonmusk"

trends:
  - "#AI"
  - "#LLM"

topics:
  - "Claude MCP"
  - "crude oil price"

Note: all accounts share the same execution parameters. For per-account customization, call x_search.py directly.

Usage

# Run everything
python3 ~/.claude/skills/x-search/watchlist.py --time 24h --lang zh --output ~/obsidian/X/

# Run one section only
python3 ~/.claude/skills/x-search/watchlist.py --only accounts --time 24h --output ~/obsidian/X/

# Custom config path
python3 ~/.claude/skills/x-search/watchlist.py --config ~/work-watchlist.yaml --time 24h

Scheduled Use (OpenClaw)

See OPENCLAW.md for full scheduling documentation — schedule formats, cron scenarios, delivery channels, and job management.

Error Handling

  • XAI_API_KEY not set: Tell the user to run export XAI_API_KEY=your_key
  • No results: Inform the user and suggest broadening the time range or checking the account name
  • API error: Show the error message and suggest checking the API key validity

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Huo15 Openclaw Enhance

火一五·克劳德·龙虾增强插件 v5.7.8 — 全面适配 openclaw 2026.4.24:peerDep ^4.24 + build/compat 同步到 4.24 + 14 处 api.on 全部去掉 as any 改成 typed hook(hookName 联合类型 + handler 自动推断 Pl...

Registry SourceRecently Updated
General

Content Trend Analyzer

Aggregates and analyzes content trends across platforms to identify hot topics, user intent, content gaps, and generates data-driven article outlines.

Registry SourceRecently Updated
General

Prompt Debugger

Debug prompts that produce unexpected AI outputs — diagnose failure modes, identify ambiguity and conflicting instructions, test variations, compare model re...

Registry SourceRecently Updated
General

Indie Maker News

独行者 Daily - 变现雷达。读对一条新闻,少走一年弯路。每天5分钟,给创业者装上商业雷达。聚焦一人公司、副业、创业变现资讯,智能分类,行动导向。用户下载即能用,无需本地部署!

Registry SourceRecently Updated