X AI 熱點雷達
核心指標
最終得分 = X 熱度 × 項目新鮮度
raw_hot_score = likes × log(1 + likes_per_hour)- 增速 = 按讚數 / (當前時間 - 發佈時間) 小時
- 項目新鮮度校驗:發現 GitHub 專案後,必須導航到倉庫頁面驗證建立日期
final_score = raw_hot_score × freshness_multiplier- 專案 < 7 天:× 1.0
- 專案 7-30 天:× 0.7
- 專案 30-90 天:× 0.3
- 專案 > 90 天:標記 ⚠️ 舊項目回鍋,不參與排名
🔴 關鍵教訓:UI-TARS-desktop (bytedance) 29K 星但 repo 已存在數月,X 貼文雖然是新的但專案不新 → 套利空間歸零。熱度高 ≠ 專案新。
搜尋矩陣(6 層探測器)
每層目標不同,涵蓋野生熱點 → 新品發佈 → 病毒傳播 → 開源爆發 → FOMO 需求全鏈路。
L0: 野生病毒(48h 視窗)🆕
捕捉不帶 AI 標籤但瘋狂傳播的產品/遊戲/工具。這是捕捉 H5 遊戲、網頁工具等非 AI 熱點的關鍵層。
("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
⚠️ 注意:L0 不要求 AI 關鍵詞,min_faves 提升到 200 以過濾雜訊。
L1: 新品發射-AI(24h 視窗)
捕捉「剛剛發佈/開源」的 AI 工具,最早訊號。
("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: 泛新品發射(24h 視窗)🆕
捕捉非 AI 的新發佈產品/遊戲/工具。
("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: 病毒傳播(48h 視窗)
捕捉正在被瘋轉的 AI 產品。
("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 星標暴增(48h 視窗)
開源 AI 專案突然爆火。
("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 視窗)
等不及、求邀請、排長隊 = 需求溢出訊號。
("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
執行流程
[Cron: 每12小時]
↓
[瀏覽器注入 X Cookie → 已登入狀態]
↓
[L0-L4 逐層搜尋 → JS 滾動收集]
↓
[合併去重 → 計算 raw_hot_score]
↓
[🔍 Step 2.5: 項目新鮮度校驗]
↓
[AI 提取:關鍵詞 + 產品名 + 項目年齡 + 一句話總結]
↓
[Top 10 排序 → 生成報告]
↓
[直接發送飛書]
Step 1: 構造搜尋 URL
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-野生病毒',
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-新品發射-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-泛新品',
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-病毒傳播',
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爆發',
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: 抓取 + 計算熱力值
// 在 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;
}
// 提取作者
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() || '';
// 提取時間
const timeEl = a.querySelector('time');
const time = timeEl?.getAttribute('datetime') || '';
// 提取連結
const statusLink = allLinks.find(l => l.href && l.href.includes('/status/'));
const link = statusLink?.href || '';
// 提取轉發數
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++;
}
// 計算熱力值
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: 項目新鮮度校驗(🔴 必須執行)
⚠️ X 熱度 ≠ 項目新。舊項目被重新提起可能在 X 上很熱,但套利視窗已關閉。
先查已知舊項目清單:references/known-stale-repos.md — 匹配到的直接排除,無需導航 GitHub。
對每個包含 GitHub 連結的訊號,必須 navigate 到倉庫頁面驗證建立日期:
// 在 GitHub 倉庫頁面執行
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 = '🆕 新品';
else if (daysSinceCreated < 30) freshnessLabel = '📈 上升';
else if (daysSinceCreated < 90) freshnessLabel = '⚠️ 舊項目回鍋';
else freshnessLabel = '💀 古董(排除)';
const freshnessMultiplier = daysSinceCreated < 7 ? 1.0 : daysSinceCreated < 30 ? 0.7 : daysSinceCreated < 90 ? 0.3 : 0;
const finalScore = Math.round(rawHotScore * freshnessMultiplier);
過濾規則:freshnessMultiplier === 0 的項目直接排除,不出現在報告中。
對於非 GitHub 項目(如新產品發佈、API、Waitlist),預設 freshnessMultiplier = 0.8(給非開源項目一定寬容度),但如果能從頁面提取發佈日期則優先使用實際日期。
Step 3: 過濾規則
// 排除話題:crypto、戰爭、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) // 熱力值門檻
.filter(p => !excludePatterns.some(r => r.test(p.text)))
.slice(0, 15);
Step 4: AI 提取關鍵詞
對每條貼文執行 prompt:
從以下 X 貼文提取熱點關鍵詞(不限 AI):
貼文:{{ text }}
發佈者:@{{ author }}
按讚:{{ likes }} | 轉發:{{ reposts }}
發佈:{{ hoursAgo }}小時前 | 增速:{{ likesPerHour }}讚/小時
輸出:
- **關鍵詞/產品名**:[提取 1-3 個核心關鍵詞]
- **一句話**:[這個工具/項目做什麼]
- **熱度評分**:[hotScore]
- **套利訊號**:強/中/弱(增速>500讚/h = 強,100-500 = 中,<100 = 弱)
Step 5: 輸出報告格式
JSON 輸出結構(demand-radar.json)
每個訊號必須包含以下全部欄位:
{
"date": "YYYY-MM-DD",
"signals": [{
"rank": 1,
"keyword": "產品/專案名",
"description": "一句話描述做什麼",
"likes": 188, "velocity": 109, "hotScore": 884,
"freshness": "🆕 新品", "finalScore": 884, "signal": "🟡 中",
"author": "@handle",
"tweetLink": "https://x.com/user/status/xxx",
"hoursAgo": 1.7,
"github": "owner/repo", "stars": "2.8K",
"sourceLayer": "L1 新品發射-AI",
"arbitrageDirection": "套利方向說明 + 推薦域名",
"domainSuggestions": ["domain1.com", "domain2.com"],
"actionPlan": "具體行動方案:做什麼、怎麼做、為什麼現在是時機",
"painPoint": "用戶痛點:為什麼有人需要這個"
}]
}
🔴 關鍵規則:每個訊號必須包含 tweetLink(原帖連結)、arbitrageDirection(套利方向)、domainSuggestions(域名建議)、actionPlan(行動方案)、painPoint(痛點)。缺少任一欄位的訊號視為不完整,不出現在報告中。
🔍 AI 熱點雷達 | {{DATE}} {{TIME}}
> **資料來源:X/Twitter 即時抓取 @claw0x**
## 📰 Today's News 側邊欄
| 話題 | 時間 | 帖數 |
|------|------|------|
| {{topic}} | {{age}} | {{posts}} |
## 🔥 Top 10 熱力榜
| # | 關鍵詞 | 讚 | 增速(讚/h) | 熱力值 | 新鮮度 | 最終得分 | 套利訊號 |
|---|--------|-----|-----------|--------|--------|---------|---------|
| 1 | xxx | 5.2K | 1,200 | 36,000 | 🆕 0.8天 | 36,000 | 🔴 強 |
### 🚀 立即行動(套利訊號 ≥ 中)
1. **{{keyword}}** — {{summary}}
- @{{author}} | {{likes}}讚 | {{likesPerHour}}讚/小時 | {{hoursAgo}}h前
- GitHub: `{{owner/repo}}` | 建立 {{daysAgo}} 天前 | {{stars}} stars
- 域名:{{domain}}.com({{status}})
- 套利方向:{{arbitrageDirection}}
## ⚠️ 已排除(舊項目回鍋)
| 項目 | 原因 | 星標 | 年齡 |
|------|------|------|------|
| UI-TARS-desktop (ByteDance) | 桌面自動化 agent,X 重新被提起 | 30.9K | >12個月 |
---
📊 掃描參數
- 搜尋層:L0 野生 / L1 新品-AI / L1-b 泛新品 / L2 病毒 / L3 GitHub / L4 FOMO
- 時間範圍:{{since}} - {{until}}
- 原始貼文:{{raw}} 條 → 去重 {{deduped}} → 過濾 {{filtered}} → 精選 {{top}} 條
- GitHub 校驗:排除 {{excluded}} 個舊項目
- 瀏覽器狀態:已登入 @claw0x
## 🔮 關鍵洞察
(列出 2-4 個本日掃描發現的關鍵趨勢)
Step 6: 部署(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 '強' in x.get('signal','')),'mediumSignal':sum(1 for x in t if '中' 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 # ⚠️ 必須 rebase,防止 non-fast-forward 拒絕
⚠️ 必須用 send_message 發飛書,不依賴 cron announce。
Cookie 注入(每次執行前)
⚠️ 詳見 references/x-auth-and-collection.md — 包含完整注入流程、async IIFE 模板、K/M 解析、hotScore 公式。
// 先導航到 x.com 再注入,然後驗證 x.com/home 登入成功
document.cookie = "auth_token=06dec19f563932f39d96f93e9d8c005d3de9b7a9; domain=.x.com; path=/; secure; SameSite=None";
配置
- X 帳戶: @claw0x(已登入瀏覽器)
- 執行頻率: 每 12 小時(9:00 + 21:00 CST)
- Cookie 有效期: 需用戶定期更新 auth_token
- 輸出目標:
daily-reports/YYYY-MM-DD/x-demand-radar.md+public/data/demand-radar.json - 部署: git push → CF Pages 自動建構
Pitfalls
- Cookie 不跨會話持久化:每次 Hermes 啟動都是新瀏覽器實例,cookie 必須重新注入。Cron 每次執行的第一步就是注入 cookie → 驗證登入。
browser_console不能直接return:必須用 IIFE(async function() { ... })()包裹,否則報Illegal return statement。詳見references/x-auth-and-collection.md。- 搜尋稀疏性屬於正常現象:min_faves≥100 + 複雜布林查詢組合下,每層 4-16 條結果屬於正常。L3(GitHub)尤其稀疏。不要降低 min_faves 門檻否則雜訊淹沒訊號。
- Today's News 側邊欄是免費訊號源:每次搜尋頁面右側顯示當日新聞話題和帖數,這些是確定性熱點,應納入報告。
- 推送必須直接發飛書:不要依賴 cron announce。結果寫入檔案後立即用 message 發送。
- 搜尋詞全球通用:所有查詢用英文,不限定地區。報告聚焦全球熱點(不限 AI)。
execute_code不支援大段內聯 JSON:將 JSON 資料直接嵌入 Python 字串會導致SyntaxError: leading zeros等解析錯誤。正確做法是先用write_file寫入臨時檔案,再用open()讀取:with open('/tmp/data.json') as f: data = json.load(f)。同樣,read_file回傳帶行號前綴的文字(如1|{...}),不能直接json.loads(),需用原生open()。- git push 可能被拒絕(non-fast-forward):遠端倉庫可能有其他 cron 實例或手動提交先於當前 push。始終執行
git pull --rebase && git push,不要單獨git push。 - JS 收集截斷的貼文文字可能丟失 GitHub URL:
text.substring(0, 300)可能截掉末尾的 GitHub 連結。如果貼文中提到 GitHub 但未提取到github.com連結,需導航到原帖 (browser_navigate到link欄位) 提取完整 URL,或用 GitHub 搜尋repo name關鍵詞查找。 - L0 層雜訊較大(已驗證):
min_faves:200擋不住大量「game changer」口語化貼文(政治/體育/生活類)。首次執行 L0 收集 19 條中僅有 4 條有潛在產品價值。建議:若連續兩次雷達 L0 訊號/雜訊比 < 20%,將min_faves提升至 500,或在 L0 查詢中加入-(political OR sports OR religion)排除詞。
補充訊號源(可選)
- GitHub Trending: https://github.com/trending?since=daily
- Product Hunt: https://www.producthunt.com/
- Hacker News: https://news.ycombinator.com/