X AI Hotspot Radar
Core Metrics
Final Score = X Heat × Project Freshness
raw_hot_score = likes × log(1 + likes_per_hour)- Velocity = likes / (current time - post time) hours
- Project Freshness Check: When a GitHub project is found, you must navigate to the repo page to verify its creation date.
final_score = raw_hot_score × freshness_multiplier- Project < 7 days: × 1.0
- Project 7-30 days: × 0.7
- Project 30-90 days: × 0.3
- Project > 90 days: mark ⚠️ Stale re-hash, not ranked
🔴 Key Lesson: UI-TARS-desktop (bytedance) had 29K stars but the repo existed for months. The X post was new, but the project wasn't → arbitrage window is zero. High heat ≠ new project.
Search Matrix (6 Layer Detectors)
Each layer targets a different stage: wild viral → new launch → viral spread → open source explosion → FOMO demand.
L0: Wild Viral (48h window) 🆕
Catches products/games/tools spreading virally without AI labels. This is the critical layer for catching H5 games, web tools, and non-AI hotspots.
("this is insane" OR "game changer" OR "holy shit" OR "mind blown" OR "this is crazy" OR "cannot believe" OR "blown away") (game OR tool OR app OR website OR "web app" OR builder OR generator OR platform OR "waitlist") min_faves:200 since:SINCE_48H
⚠️ Note: L0 does NOT require AI keywords; min_faves is raised to 200 to filter noise.
L1: New Launch-AI (24h window)
Catches newly launched/open-sourced AI tools, the earliest signal.
("just launched" OR "just dropped" OR "just shipped" OR "new AI tool" OR "just released" OR "introducing" OR "launching today") (AI OR LLM OR GPT OR agent OR open source) min_faves:30 since:SINCE_24H
L1-b: General New Launch (24h window) 🆕
Catches non-AI newly launched products/games/tools.
("just launched" OR "just dropped" OR "just shipped" OR "just released" OR "introducing" OR "launching today" OR "new" OR "announcing") (game OR tool OR app OR website OR "web app" OR builder OR platform) min_faves:100 since:SINCE_24H
L2: Viral Spread (48h window)
Catches AI products being shared wildly.
("this is insane" OR "game changer" OR "holy shit" OR "mind blown" OR "this is crazy" OR "cannot believe" OR "blown away") (AI OR LLM OR GPT OR agent OR tool) min_faves:100 since:SINCE_48H
L3: GitHub Star Surge (48h window)
Open source AI projects suddenly blowing up.
("github.com" OR "open source") (AI OR LLM OR GPT OR agent) ("stars" OR "trending" OR "blew up" OR "blowing up" OR "just hit") min_faves:100 since:SINCE_48H
L4: FOMO / Waitlist (72h window)
Can't wait, invite requests, long waitlists = demand overflow signal.
("waitlist" OR "beta access" OR "invite" OR "early access" OR "can't wait" OR "need this") (AI OR LLM OR tool OR app) min_faves:50 since:SINCE_72H
Execution Flow
[Cron: every 12 hours]
↓
[Inject X Cookie into browser → logged-in state]
↓
[L0-L4 layer-by-layer search → JS scrolling collection]
↓
[Deduplicate → calculate raw_hot_score]
↓
[🔍 Step 2.5: Project freshness check]
↓
[AI extraction: keyword + product name + project age + one-line summary]
↓
[Top 10 ranking → generate report]
↓
[Send directly to Feishu]
Step 1: Construct Search URLs
const now = new Date();
const since24h = new Date(now - 24*60*60*1000).toISOString().split('T')[0];
const since48h = new Date(now - 48*60*60*1000).toISOString().split('T')[0];
const since72h = new Date(now - 72*60*60*1000).toISOString().split('T')[0];
const SEARCH_GROUPS = [
{
layer: 'L0-Wild Viral',
q: `("this is insane" OR "game changer" OR "holy shit" OR "mind blown" OR "this is crazy" OR "cannot believe" OR "blown away") (game OR tool OR app OR website OR "web app" OR builder OR generator OR platform OR "waitlist") min_faves:200 since:${since48h}`,
since: since48h
},
{
layer: 'L1-New Launch-AI',
q: `("just launched" OR "just dropped" OR "just shipped" OR "new AI tool" OR "just released" OR "introducing") (AI OR LLM OR GPT OR agent OR "open source") min_faves:30 since:${since24h}`,
since: since24h
},
{
layer: 'L1-b-General New',
q: `("just launched" OR "just dropped" OR "just shipped" OR "just released" OR "introducing" OR "launching today" OR "new" OR "announcing") (game OR tool OR app OR website OR "web app" OR builder OR platform) min_faves:100 since:${since24h}`,
since: since24h
},
{
layer: 'L2-Viral Spread',
q: `("this is insane" OR "game changer" OR "holy shit" OR "mind blown" OR "this is crazy" OR "cannot believe" OR "blown away") (AI OR LLM OR GPT OR agent OR tool) min_faves:100 since:${since48h}`,
since: since48h
},
{
layer: 'L3-GitHub Explosion',
q: `("github.com" OR "open source") (AI OR LLM OR GPT OR agent) ("stars" OR "trending" OR "blew up" OR "blowing up" OR "just hit") min_faves:100 since:${since48h}`,
since: since48h
},
{
layer: 'L4-FOMO',
q: `("waitlist" OR "beta access" OR "invite" OR "early access" OR "can't wait" OR "need this") (AI OR LLM OR tool OR app) min_faves:50 since:${since72h}`,
since: since72h
}
];
Step 2: Scrape + Calculate Heat Score
// Run in browser console
async function collectAndScore(sinceHours) {
let allPosts = [];
let prevCount = 0;
let scrolls = 0;
const maxScrolls = 12;
while (scrolls < maxScrolls) {
const articles = document.querySelectorAll('article');
articles.forEach((a) => {
const textEl = a.querySelector('[data-testid="tweetText"]') || a.querySelector('[lang]');
const text = textEl?.innerText || '';
if (!text || text.length < 30) return;
const likesEl = a.querySelector('[data-testid="like"] span');
let likes = 0;
if (likesEl) {
const txt = likesEl.innerText.replace(/,/g, '');
if (txt.includes('K')) likes = Math.round(parseFloat(txt.replace('K','')) * 1000);
else if (txt.includes('M')) likes = Math.round(parseFloat(txt.replace('M','')) * 1000000);
else likes = parseInt(txt) || 0;
}
// Extract author
const allLinks = Array.from(a.querySelectorAll('a[role="link"]'));
const authorLink = allLinks.find(l => l.href && l.href.includes('x.com/') && !l.href.includes('/status/') && !l.href.includes('search') && !l.href.includes('hashtag'));
const author = authorLink?.href?.split('/').pop() || '';
// Extract time
const timeEl = a.querySelector('time');
const time = timeEl?.getAttribute('datetime') || '';
// Extract link
const statusLink = allLinks.find(l => l.href && l.href.includes('/status/'));
const link = statusLink?.href || '';
// Extract repost count
const repostEl = a.querySelector('[data-testid="retweet"] span, [data-testid="repost"] span');
let reposts = 0;
if (repostEl) {
const txt = repostEl.innerText.replace(/,/g, '');
if (txt.includes('K')) reposts = Math.round(parseFloat(txt.replace('K','')) * 1000);
else reposts = parseInt(txt) || 0;
}
if (!allPosts.some(p => p.text === text)) {
allPosts.push({ text: text.substring(0, 400), likes, reposts, author, time, link });
}
});
if (allPosts.length === prevCount && scrolls > 2) break;
prevCount = allPosts.length;
window.scrollBy(0, 600);
await new Promise(r => setTimeout(r, 1500));
scrolls++;
}
// Calculate heat score
const now = new Date();
return allPosts.map(p => {
const postTime = new Date(p.time);
const hoursAgo = Math.max(0.1, (now - postTime) / (1000 * 60 * 60));
const likesPerHour = p.likes / hoursAgo;
const hotScore = Math.round(p.likes * Math.log(1 + likesPerHour));
return { ...p, hoursAgo: Math.round(hoursAgo * 10) / 10, likesPerHour: Math.round(likesPerHour), hotScore };
}).sort((a, b) => b.hotScore - a.hotScore);
}
Step 2.5: Project Freshness Check (🔴 Mandatory)
⚠️ X heat ≠ project newness. Old projects can be hot on X when re-mentioned, but the arbitrage window is closed.
First check the known stale project list: references/known-stale-repos.md — matching items are excluded directly, no need to navigate GitHub.
For every signal containing a GitHub link, you must navigate to the repo page to verify the creation date:
// Run on the GitHub repo page
const createdEl = document.querySelector('relative-time');
const createdAt = createdEl?.getAttribute('datetime') || '';
const daysSinceCreated = (new Date() - new Date(createdAt)) / (1000 * 60 * 60 * 24);
let freshnessLabel;
if (daysSinceCreated < 7) freshnessLabel = '🆕 New';
else if (daysSinceCreated < 30) freshnessLabel = '📈 Rising';
else if (daysSinceCreated < 90) freshnessLabel = '⚠️ Stale re-hash';
else freshnessLabel = '💀 Ancient (exclude)';
const freshnessMultiplier = daysSinceCreated < 7 ? 1.0 : daysSinceCreated < 30 ? 0.7 : daysSinceCreated < 90 ? 0.3 : 0;
const finalScore = Math.round(rawHotScore * freshnessMultiplier);
Filter rule: Projects with freshnessMultiplier === 0 are excluded directly and do not appear in the report.
For non-GitHub projects (e.g., new product launches, APIs, Waitlists), default freshnessMultiplier = 0.8 (some tolerance for non-OSS projects), but if a release date can be extracted from the page, use the actual date.
Step 3: Filter Rules
// Exclude topics: crypto, war, NSFW, meme coin
const excludePatterns = [
/crypto|bitcoin|nft|token.*sale/i,
/war|killed|attack|bomb/i,
/nsfw|onlyfans|porn/i,
/ai.*girlfriend|ai.*waifu/i,
/meme.*coin/i
];
const filtered = allPosts
.filter(p => p.hotScore >= 200) // Heat score threshold
.filter(p => !excludePatterns.some(r => r.test(p.text)))
.slice(0, 15);
Step 4: AI Keyword Extraction
Run this prompt for each post:
Extract hotspot keywords from the following X post (not limited to AI):
Post: {{ text }}
Author: @{{ author }}
Likes: {{ likes }} | Reposts: {{ reposts }}
Posted: {{ hoursAgo }} hours ago | Velocity: {{ likesPerHour }} likes/hour
Output:
- **Keyword/Product Name**: [Extract 1-3 core keywords]
- **One-Liner**: [What this tool/project does]
- **Heat Score**: [hotScore]
- **Arbitrage Signal**: Strong/Medium/Weak (velocity > 500 likes/h = Strong, 100-500 = Medium, < 100 = Weak)
Step 5: Output Report Format
JSON Output Structure (demand-radar.json)
Each signal must include ALL of the following fields:
{
"date": "YYYY-MM-DD",
"signals": [{
"rank": 1,
"keyword": "Product/Project Name",
"description": "One-line description of what it does",
"likes": 188, "velocity": 109, "hotScore": 884,
"freshness": "🆕 New", "finalScore": 884, "signal": "🟡 Medium",
"author": "@handle",
"tweetLink": "https://x.com/user/status/xxx",
"hoursAgo": 1.7,
"github": "owner/repo", "stars": "2.8K",
"sourceLayer": "L1 New Launch-AI",
"arbitrageDirection": "Arbitrage direction explanation + recommended domains",
"domainSuggestions": ["domain1.com", "domain2.com"],
"actionPlan": "Specific action plan: what to do, how, why now is the time",
"painPoint": "User pain point: why someone needs this"
}]
}
🔴 Key Rule: Every signal must include tweetLink (original post link), arbitrageDirection, domainSuggestions, actionPlan, and painPoint. Signals missing any of these fields are considered incomplete and will not appear in the report.
🔍 AI Hotspot Radar | {{DATE}} {{TIME}}
> **Data Source: X/Twitter real-time scraping @claw0x**
## 📰 Today's News Sidebar
| Topic | Time | Posts |
|-------|------|-------|
| {{topic}} | {{age}} | {{posts}} |
## 🔥 Top 10 Heat Ranking
| # | Keyword | Likes | Velocity (likes/h) | Heat Score | Freshness | Final Score | Arbitrage Signal |
|---|---------|-------|--------------------|------------|-----------|-------------|------------------|
| 1 | xxx | 5.2K | 1,200 | 36,000 | 🆕 0.8d | 36,000 | 🔴 Strong |
### 🚀 Act Now (Signal ≥ Medium)
1. **{{keyword}}** — {{summary}}
- @{{author}} | {{likes}} likes | {{likesPerHour}} likes/h | {{hoursAgo}}h ago
- GitHub: `{{owner/repo}}` | Created {{daysAgo}} days ago | {{stars}} stars
- Domain: {{domain}}.com ({{status}})
- Arbitrage Direction: {{arbitrageDirection}}
## ⚠️ Excluded (Stale Re-hash)
| Project | Reason | Stars | Age |
|---------|--------|-------|-----|
| UI-TARS-desktop (ByteDance) | Desktop automation agent, re-mentioned on X | 30.9K | >12 months |
---
📊 Scan Parameters
- Search Layers: L0 Wild / L1 New-AI / L1-b General New / L2 Viral / L3 GitHub / L4 FOMO
- Time Range: {{since}} - {{until}}
- Raw posts: {{raw}} → Deduplicated {{deduped}} → Filtered {{filtered}} → Selected {{top}}
- GitHub validation: Excluded {{excluded}} stale projects
- Browser status: Logged in as @claw0x
## 🔮 Key Insights
(List 2-4 key trends discovered in today's scan)
Step 6: Deployment (git push → CF Pages)
cd /Volumes/sunzi/Code/ludusAI
# Save per-date JSON snapshot for /radar detail pages
cp public/data/demand-radar.json "public/data/radar/YYYY-MM-DD.json" 2>/dev/null || true
# Build manifest
ls public/data/radar/*.json | python3 -c "
import json,os,sys
m=[]
for f in sys.stdin.read().strip().split():
d=json.load(open(f))
t=d.get('top10',[])
m.append({'date':os.path.basename(f).replace('.json',''),'topKeywords':[x.get('keyword','') for x in t[:3]],'signalCount':len(t),'newsTopics':[n.get('topic','') for n in d.get('news',[])[:2]],'insights':d.get('insights',[])[:3],'strongSignal':sum(1 for x in t if 'Strong' in x.get('signal','')),'mediumSignal':sum(1 for x in t if 'Medium' in x.get('signal','')),'raw':d.get('scanParams',{}).get('raw',0),'top':d.get('scanParams',{}).get('top',0),'excluded':d.get('scanParams',{}).get('githubExcluded',0),'layers':d.get('scanParams',{}).get('layers',[])})
m.sort(key=lambda x:x['date'],reverse=True)
json.dump(m,open('public/data/radar-manifest.json','w'),ensure_ascii=False,indent=2)
print(f'manifest: {len(m)} reports')
"
git add daily-reports/YYYY-MM-DD/x-demand-radar.md public/data/demand-radar.json public/data/radar/YYYY-MM-DD.json public/data/radar-manifest.json
git commit -m "radar: YYYY-MM-DD HH:MM CST - <top signal summary>"
git pull --rebase && git push # ⚠️ Must rebase, to prevent non-fast-forward rejection
⚠️ Must use send_message to send to Feishu, do not rely on cron announce.
Cookie Injection (Before Each Execution)
⚠️ See references/x-auth-and-collection.md — includes full injection flow, async IIFE templates, K/M parsing, and hotScore formula.
// First navigate to x.com, then inject, then verify x.com/home login success
document.cookie = "auth_token=06dec19f563932f39d96f93e9d8c005d3de9b7a9; domain=.x.com; path=/; secure; SameSite=None";
Configuration
- X Account: @claw0x (browser logged in)
- Execution Frequency: Every 12 hours (9:00 + 21:00 CST)
- Cookie Validity: User needs to periodically update auth_token
- Output Targets:
daily-reports/YYYY-MM-DD/x-demand-radar.md+public/data/demand-radar.json - Deployment: git push → CF Pages auto-build
Pitfalls
- Cookies don't persist across sessions: Each Hermes start is a new browser instance; cookies must be re-injected. The first step of each cron execution is to inject cookies → verify login.
browser_consolecannot directlyreturn: Must wrap with IIFE(async function() { ... })()otherwiseIllegal return statementerror. Seereferences/x-auth-and-collection.md.- Sparse search results are normal: With min_faves ≥ 100 and complex boolean queries, 4-16 results per layer is normal. L3 (GitHub) is especially sparse. Do not lower the min_faves threshold or noise will drown out signals.
- Today's News sidebar is a free signal source: The right sidebar on each search page shows current news topics and post counts. These are definite hotspots and should be included in the report.
- Push must go directly to Feishu: Do not rely on cron announce. Send the message immediately after writing results to files.
- Search terms are global: All queries are in English, no region restriction. Reports focus on global hotspots (not limited to AI).
execute_codedoes not support inline JSON: Embedding JSON data directly in Python strings causesSyntaxError: leading zerosparsing errors. Correct approach: usewrite_fileto write a temporary file, thenopen()to read it:with open('/tmp/data.json') as f: data = json.load(f). Similarly,read_filereturns text with line number prefixes (e.g.1|{...}), which cannot be directlyjson.loads()-ed; use nativeopen().- git push may be rejected (non-fast-forward): The remote may have other cron instances or manual commits ahead of the current push. Always execute
git pull --rebase && git push, nevergit pushalone. - Truncated post text from JS collection may lose GitHub URLs:
text.substring(0, 300)might cut off trailing GitHub links. If a post mentions GitHub but thegithub.comlink is not extracted, navigate to the original post (browser_navigateto thelinkfield) to get the full URL, or search GitHub with therepo namekeywords. - L0 layer is noisy (verified):
min_faves:200doesn't filter out many colloquial "game changer" posts (politics/sports/life). On first run, L0 collected 19 posts but only 4 had potential product value. Suggestion: If L0 signal/noise ratio is < 20% for two consecutive radar runs, raisemin_favesto 500, or add-(political OR sports OR religion)exclusion terms to the L0 query.
Supplemental Signal Sources (Optional)
- GitHub Trending: https://github.com/trending?since=daily
- Product Hunt: https://www.producthunt.com/
- Hacker News: https://news.ycombinator.com/