Install
openclaw skills install @jiangsier-xyz/x-hotsFetch trending topics from X (Twitter). Analyze user interests from natural language, retrieve top hot topics per domain, and summarize background, key opinions, and controversies.
openclaw skills install @jiangsier-xyz/x-hotsFetch real-time trending topics from X, filter by user interest domains, and analyze the background, popular opinions, and key controversies of each topic.
Install tweepy:
pip3 install tweepy
The following X (Twitter) API credentials must be configured as environment variables:
export X_API_KEY="***"
export X_API_SECRET="***"
export X_ACCESS_TOKEN="***"
export X_ACCESS_TOKEN_SECRET="***"
export X_BEARER_TOKEN="***"
Obtain these credentials from the X Developer Portal.
Note: The Free tier API has limitations:
When the user wants to know what's trending on X/Twitter, or asks about hot topics, public opinion, or viral discussions.
Extract interest domains from the user's natural language input. Common domains include:
Analysis Rules:
python3 scripts/x_hots.py '<json_queries>'
Parameters:
json_queries: JSON array of search keywordsExamples:
# Tech + Economy domains
python3 scripts/x_hots.py '["AI", "LLM", "stock market", "tariff"]'
# International politics
python3 scripts/x_hots.py '["geopolitics", "diplomacy", "sanctions"]'
# Generic hot topics (when no domain can be identified)
python3 scripts/x_hots.py '["trending", "breaking", "viral"]'
Output Format:
{
"success": true,
"timestamp": "2026-07-09T03:58:00Z",
"queries": ["AI", "LLM"],
"results": {
"AI": {
"success": true,
"count": 10,
"tweets": [
{
"id": "1234567890",
"text": "Tweet content...",
"created_at": "2026-07-09T03:50:00Z",
"metrics": {"like_count": 100, "retweet_count": 50},
"url": "https://twitter.com/twitter/status/1234567890"
}
]
}
}
}
For each domain/keyword, analyze the returned tweets and extract:
Presentation Format:
## 🔥 [Domain Name] Hot Topics
### Topic 1: [Topic Title]
**📌 Background**
[Brief description of the event origin, timeline, key figures/organizations]
**💬 Popular Opinions**
- Supporters: [core argument]
- Opponents: [core argument]
- Neutral: [objective analysis]
**⚔️ Key Controversies**
[Focal point of the debate, divergence between different stances]
---
### Topic 2: [Topic Title]
...
When the user's input cannot be mapped to a specific domain (e.g., "what's hot on X?"), use the following strategy:
Run the script with generic hot topic queries:
python3 scripts/x_hots.py '["trending", "breaking", "viral", "news"]'
Identify the Top 10 highest-engagement topics from the returned tweets (based on likes, retweets, replies)
Present them ranked by engagement, with a brief background for each topic
User input: "What's hot in tech?"
Analysis: Domain = Tech, Keywords = ["AI", "LLM", "tech"]
Execute:
python3 scripts/x_hots.py '["AI", "LLM", "tech"]'
User input: "What's happening with tariff policy?"
Analysis: Topic = Tariff, Keywords = ["tariff", "trade war", "tariff policy"]
Execute:
python3 scripts/x_hots.py '["tariff", "trade war", "tariff policy"]'
User input: "What's hot on X?"
Analysis: No specific domain identified, use generic query
Execute:
python3 scripts/x_hots.py '["trending", "breaking", "viral", "news"]'
lang:en); modify the script for other languages-is:retweet), only returns original tweets{"success": false, "error": "Missing environment variables: X_API_KEY, ..."}
Fix: Ensure the following environment variables are set in your shell profile (e.g., ~/.zshrc):
export X_API_KEY="***"
export X_API_SECRET="***"
export X_ACCESS_TOKEN="***"
export X_ACCESS_TOKEN_SECRET="***"
export X_BEARER_TOKEN="***"
Obtain credentials from the X Developer Portal.
{"results": {"AI": {"success": true, "count": 0, "tweets": []}}}
Action: Inform the user that there are no hot topics in this domain currently; suggest trying different keywords
{"success": false, "error": "429 Too Many Requests"}
Action: Wait 15 minutes before retrying, or reduce the number of query keywords