🟡 Binance 热度猎杀 Skill v2.0 整合多数据源(0 浏览器依赖)→ 统一交易信号 数据源:Fear&Greed API + 新闻 RSS + Binance Ticker + (可选) Browser快照 --- 核心脚本 --- 使用方式 推荐:快速模式(无需浏览器) 输出示例 : --- 数据源说明 | 数据 | 来源 | 依赖 | |------|------|------| | 恐惧贪婪指数 | Alternative.me API | ✅ 纯API | | 新闻情绪 | CoinTelegraph + CoinDesk RSS | ✅ 纯API | | BTC/ETH价格 | Binance data-api | ✅ 纯API | | 热搜币排行 | Binance Square 页面 | ⚠️ Browser | | 帖子盈亏 | Binance Square 页面 | ⚠️ Browser | Browser 数据为补充 ,核心信号完全无需浏览器。 --- 信号规则 | 条件 | 信号 | 操作 | |------|------|------| | BTC<-1.5% + 新闻偏空 | 🔴 BEARISH | 检查BTC below YES | | BTC<-4% + 极度恐惧 | 🟢 HIGH | 观察BTC above抄底 | | BTC…

, line)\n if m: lines.append(m.group(1))\n elif line.startswith(\"- heading:\"):\n m = re.search(r'^-\\s*heading:\\s*(.+?)\\s*\\[', line)\n if m: lines.append(\"TITLE:\" + m.group(1))\n elif line.startswith(\"- link:\"):\n # 提取链接文本\n m = re.search(r'link:\\s*\\\"([^\\\"]+)\\\"', line)\n if m: lines.append(\"LINK:\" + m.group(1))\n elif line.startswith(\"- img:\"):\n pass # skip images\n else:\n lines.append(line)\n\n # 找帖子段落:时间 + 情绪 模式开始\n i = 0\n while i \u003c len(lines):\n # 检查是否是帖子开头(时间+情绪标签)\n time_m = re.match(r'^(\\d+)\\s*(分钟|小时|天)

🟡 Binance 热度猎杀 Skill v2.0 整合多数据源(0 浏览器依赖)→ 统一交易信号 数据源:Fear&Greed API + 新闻 RSS + Binance Ticker + (可选) Browser快照 --- 核心脚本 --- 使用方式 推荐:快速模式(无需浏览器) 输出示例 : --- 数据源说明 | 数据 | 来源 | 依赖 | |------|------|------| | 恐惧贪婪指数 | Alternative.me API | ✅ 纯API | | 新闻情绪 | CoinTelegraph + CoinDesk RSS | ✅ 纯API | | BTC/ETH价格 | Binance data-api | ✅ 纯API | | 热搜币排行 | Binance Square 页面 | ⚠️ Browser | | 帖子盈亏 | Binance Square 页面 | ⚠️ Browser | Browser 数据为补充 ,核心信号完全无需浏览器。 --- 信号规则 | 条件 | 信号 | 操作 | |------|------|------| | BTC<-1.5% + 新闻偏空 | 🔴 BEARISH | 检查BTC below YES | | BTC<-4% + 极度恐惧 | 🟢 HIGH | 观察BTC above抄底 | | BTC…

, lines[i])\n if time_m:\n post = {\n \"time\": time_m.group(1) + time_m.group(2),\n \"sentiment\": None,\n \"text\": \"\",\n \"coins\": [],\n \"pnl\": None,\n \"views\": 0,\n \"comments\": 0,\n \"forwards\": 0,\n }\n # 情感检测:下一行如果是看涨/看跌\n if i + 1 \u003c len(lines) and lines[i+1].strip() in (\"看涨\", \"看跌\"):\n post[\"sentiment\"] = lines[i+1].strip()\n # 收集帖子内容(直到下一个时间或空行过多)\n j = i + 1\n content_lines = []\n while j \u003c len(lines):\n l = lines[j]\n # 遇到下一个帖子,停止\n if re.match(r'^\\d+\\s*(分钟|小时|天)', l):\n break\n # 忽略互动数字(单独的数字行)\n if re.match(r'^\\d+

🟡 Binance 热度猎杀 Skill v2.0 整合多数据源(0 浏览器依赖)→ 统一交易信号 数据源:Fear&Greed API + 新闻 RSS + Binance Ticker + (可选) Browser快照 --- 核心脚本 --- 使用方式 推荐:快速模式(无需浏览器) 输出示例 : --- 数据源说明 | 数据 | 来源 | 依赖 | |------|------|------| | 恐惧贪婪指数 | Alternative.me API | ✅ 纯API | | 新闻情绪 | CoinTelegraph + CoinDesk RSS | ✅ 纯API | | BTC/ETH价格 | Binance data-api | ✅ 纯API | | 热搜币排行 | Binance Square 页面 | ⚠️ Browser | | 帖子盈亏 | Binance Square 页面 | ⚠️ Browser | Browser 数据为补充 ,核心信号完全无需浏览器。 --- 信号规则 | 条件 | 信号 | 操作 | |------|------|------| | BTC<-1.5% + 新闻偏空 | 🔴 BEARISH | 检查BTC below YES | | BTC<-4% + 极度恐惧 | 🟢 HIGH | 观察BTC above抄底 | | BTC…

, l):\n j += 1\n continue\n # 忽略常见非内容行\n if l in (\"看涨\", \"看跌\", \"已投票!请明天再来。\",\n \"什么是加密货币恐惧和贪婪指数?\", \"自动翻译\"):\n j += 1\n continue\n # 提取币种\n for coin in re.findall(r'\\$([A-Z]{2,10})', l):\n if coin not in EXCLUDED:\n post[\"coins\"].append(coin)\n # 提取盈亏\n pnl_m = re.search(r'[+-]\\d[\\d,]+\\.\\d+', l)\n if pnl_m and not post[\"pnl\"]:\n try:\n val = float(pnl_m.group().replace(\",\",\"\"))\n post[\"pnl\"] = val\n except: pass\n # 提取互动数字(按顺序: views, comments, forwards)\n # 出现在内容行之后的一系列数字\n if content_lines and len(content_lines) > 0:\n nums = re.findall(r'\\d+', l)\n if len(nums) == 1 and int(nums[0]) > 10 and int(nums[0]) \u003c 1000000:\n if post[\"views\"] == 0:\n post[\"views\"] = int(nums[0])\n elif post[\"comments\"] == 0:\n post[\"comments\"] = int(nums[0])\n elif post[\"forwards\"] == 0:\n post[\"forwards\"] = int(nums[0])\n # 内容行累积\n if l and not re.match(r'^[\\d,.]+

🟡 Binance 热度猎杀 Skill v2.0 整合多数据源(0 浏览器依赖)→ 统一交易信号 数据源:Fear&Greed API + 新闻 RSS + Binance Ticker + (可选) Browser快照 --- 核心脚本 --- 使用方式 推荐:快速模式(无需浏览器) 输出示例 : --- 数据源说明 | 数据 | 来源 | 依赖 | |------|------|------| | 恐惧贪婪指数 | Alternative.me API | ✅ 纯API | | 新闻情绪 | CoinTelegraph + CoinDesk RSS | ✅ 纯API | | BTC/ETH价格 | Binance data-api | ✅ 纯API | | 热搜币排行 | Binance Square 页面 | ⚠️ Browser | | 帖子盈亏 | Binance Square 页面 | ⚠️ Browser | Browser 数据为补充 ,核心信号完全无需浏览器。 --- 信号规则 | 条件 | 信号 | 操作 | |------|------|------| | BTC<-1.5% + 新闻偏空 | 🔴 BEARISH | 检查BTC below YES | | BTC<-4% + 极度恐惧 | 🟢 HIGH | 观察BTC above抄底 | | BTC…

, l) and len(l) > 3:\n content_lines.append(l)\n j += 1\n post[\"text\"] = \" \".join(content_lines[:5])[:150]\n if post[\"text\"] or post[\"coins\"] or post[\"pnl\"] is not None:\n posts.append(post)\n i = j\n else:\n i += 1\n\n return posts\n\n# ============ 主报告 ============\ndef main():\n parser = argparse.ArgumentParser()\n parser.add_argument(\"--fast\", action=\"store_true\", help=\"纯API,无browser\")\n args = parser.parse_args()\n now = datetime.now(timezone(timedelta(hours=8))).strftime(\"%Y-%m-%d %H:%M\")\n\n print(f\"\\n{'='*60}\", flush=True)\n print(f\"📊 热度猎杀 v4.0 | {now}\", flush=True)\n print(f\"{'='*60}\", flush=True)\n\n # API 数据\n with ThreadPoolExecutor(max_workers=6) as ex:\n fg_f = ex.submit(fetch_fear_greed)\n news_f = ex.submit(fetch_news_sentiment)\n btc_f = ex.submit(fetch_binance_ticker, \"BTCUSDT\")\n eth_f = ex.submit(fetch_binance_ticker, \"ETHUSDT\")\n fg = fg_f.result(); news = news_f.result()\n btc = btc_f.result(); eth = eth_f.result()\n\n fg_v = fg.get(\"value\")\n btc_chg = btc.get(\"change\", 0)\n eth_chg = eth.get(\"change\", 0)\n bdir = \"↑\" if btc_chg > 0.5 else \"↓\" if btc_chg \u003c -0.5 else \"→\"\n edir = \"↑\" if eth_chg > 0.5 else \"↓\" if eth_chg \u003c -0.5 else \"→\"\n\n mood = \"中性\"\n if fg_v:\n if fg_v \u003c 25: mood = \"极度恐惧\"\n elif fg_v \u003c 45: mood = \"恐惧\"\n elif fg_v > 75: mood = \"极度贪婪\"\n elif fg_v > 55: mood = \"贪婪\"\n emoji = \"😱\" if fg_v and fg_v \u003c 45 else \"😈\" if fg_v and fg_v > 55 else \"😐\"\n\n ns = news[\"signal\"]\n ns_emoji = \"🟢\" if ns == \"BULLISH\" else \"🔴\" if ns == \"BEARISH\" else \"⚪\"\n\n print(f\"\\n【市场情绪】\", flush=True)\n print(f\" {emoji} 恐惧贪婪: {fg_v} ({fg.get('label','?')}) → {mood}\", flush=True)\n print(f\" 📰 新闻: {ns_emoji}{ns} | 🟢{news['bullish']} 🔴{news['bearish']} 中{news['neutral']}\", flush=True)\n if news.get(\"headlines\"):\n print(f\" 头条: {news['headlines'][0][:65]}\", flush=True)\n\n print(f\"\\n【行情数据】\", flush=True)\n print(f\" ₿ BTC: ${btc.get('price',0):>10,.0f} {bdir}{btc_chg:+.2f}% | 高{btc.get('high',0):,.0f} 低{btc.get('low',0):,.0f}\", flush=True)\n print(f\" Ξ ETH: ${eth.get('price',0):>10,.0f} {edir}{eth_chg:+.2f}% | 高{eth.get('high',0):,.0f} 低{eth.get('low',0):,.0f}\", flush=True)\n if btc.get(\"volume\"):\n print(f\" 💧 成交: BTC ${btc['volume']/1e9:.1f}B ETH ${eth.get('volume',0)/1e6:.0f}M\", flush=True)\n\n # Browser: 抓 Square 主页\n posts = []\n if not args.fast:\n try:\n from playwright.sync_api import sync_playwright\n with sync_playwright() as p:\n browser = p.chromium.launch(headless=True, args=[\"--no-sandbox\"])\n page = browser.new_page(viewport={\"width\": 1400, \"height\": 900})\n try:\n page.goto(\"https://www.binance.com/zh-CN/square/fear-and-greed-index\",\n timeout=15000, wait_until=\"domcontentloaded\")\n page.wait_for_timeout(7000)\n # 滚动加载更多内容\n page.evaluate(\"window.scrollTo(0, document.body.scrollHeight * 0.6)\")\n page.wait_for_timeout(2000)\n body_text = page.inner_text(\"body\")\n posts = parse_square_snapshot(body_text)\n print(f\"\\n🔥 抓取到 {len(posts)} 个热门帖子\", flush=True)\n finally:\n browser.close()\n except Exception as e:\n print(f\"\\n⚠️ Browser 异常: {e}\", flush=True)\n\n if posts:\n # 聚合\n bullish_cnt = sum(1 for p in posts if p.get(\"sentiment\") == \"看涨\")\n bearish_cnt = sum(1 for p in posts if p.get(\"sentiment\") == \"看跌\")\n all_coins = []\n for p in posts:\n for c in p.get(\"coins\", []):\n if c not in EXCLUDED:\n all_coins.append(c)\n coin_counts = {}\n for c in all_coins:\n coin_counts[c] = coin_counts.get(c, 0) + 1\n top_coins = sorted(coin_counts.items(), key=lambda x: x[1], reverse=True)[:6]\n total_views = sum(p.get(\"views\", 0) for p in posts)\n\n print(f\"\\n【热门帖子】(共{len(posts)}帖, {total_views:,}总浏览)\", flush=True)\n print(f\" 帖子情绪: 🟢看多{bullish_cnt} | 🔴看空{bearish_cnt} | ⚪中立{len(posts)-bullish_cnt-bearish_cnt}\", flush=True)\n if top_coins:\n print(f\" 高频币种: \" + \" \".join(f\"{c}({n})\" for c,n in top_coins), flush=True)\n print(f\" 帖子摘要:\", flush=True)\n for i, p in enumerate(posts[:5]):\n sent = \"🟢\" if p.get(\"sentiment\") == \"看涨\" else \"🔴\" if p.get(\"sentiment\") == \"看跌\" else \"⚪\"\n pnl_s = f\"${p['pnl']:+,}\" if p.get(\"pnl\") is not None else \"\"\n coins_s = \" \".join(f\"${c}\" for c in p.get(\"coins\", [])[:3])\n views_s = f\"👁{p.get('views',0):,}\" if p.get('views') else \"\"\n print(f\" [{i+1}] {sent} {pnl_s:>12s} {views_s:>8s} {p['text'][:50]} {coins_s}\", flush=True)\n\n # 信号\n print(f\"\\n【信号判断】\", flush=True)\n signals = []\n if btc_chg \u003c -3: signals.append(f\"₿ BTC急跌 {btc_chg:+.1f}%\")\n elif btc_chg \u003c -1.5 and news[\"signal\"] == \"BEARISH\": signals.append(f\"₿ BTC下跌+新闻偏空\")\n if eth_chg \u003c -4: signals.append(f\"Ξ ETH急跌 {eth_chg:+.1f}%\")\n if news[\"signal\"] == \"BEARISH\" and news[\"bearish\"] > news[\"bullish\"] * 2:\n signals.append(f\"📰 新闻偏空({news['bearish']}v{news['bullish']})\")\n if posts:\n pnl_posts = [p for p in posts if p.get(\"pnl\") is not None]\n if pnl_posts:\n total_pnl = sum(p[\"pnl\"] for p in pnl_posts)\n if total_pnl > 0: signals.append(f\"🐋 大户总盈利 ${total_pnl:,.0f}\")\n else: signals.append(f\"🐋 大户总亏损 ${total_pnl:,.0f}\")\n if not signals:\n signals.append(\"无特殊信号,等待机会\")\n for s in signals:\n print(f\" → {s}\", flush=True)\n\n print(f\"\\n{'='*60}\", flush=True)\n print(f\"📋 {now} | Browser: {'✅开启' if not args.fast else '⚠️纯API'}\", flush=True)\n print(f\"{'='*60}\", flush=True)\n\n with open(\"/tmp/hunt_signals.json\", \"w\") as f:\n json.dump({\n \"scan_time\": now, \"fear_greed\": fg, \"market_mood\": mood,\n \"btc\": btc, \"eth\": eth, \"news\": news,\n \"posts\": posts, \"signals\": signals,\n }, f, ensure_ascii=False, indent=2)\n\nif __name__ == \"__main__\":\n main()\n","content_type":"text/x-python; charset=utf-8","language":"python","size":13785,"content_sha256":"1aa6f5bfa261c77542113be284f9aae501f4e8fcf1313dee7ab242327aa1778f"},{"filename":"scripts/scan_square_hunt.py","content":"#!/usr/bin/env python3\n\"\"\"\nBinance Square 热度猎杀整合脚本 v2.0\n整合多数据源 → 统一交易信号\n\n用法:\n python3 scan_square_hunt.py # 完整模式(需先保存browser snapshot)\n python3 scan_square_hunt.py --fast # 快速模式(无需browser,纯API)\n python3 scan_square_hunt.py --all # 全部模式(包含browser快照解析)\n\"\"\"\nimport os, sys, json, re, argparse, urllib.request\nfrom datetime import datetime, timezone, timedelta\nfrom concurrent.futures import ThreadPoolExecutor\n\n# 清除代理\nfor k in list(os.environ.keys()):\n if 'proxy' in k.lower():\n del os.environ[k]\n\nHEADERS = {\"User-Agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36\"}\n\nEXCLUDED_COINS = {\n \"BTC\",\"ETH\",\"SOL\",\"BNB\",\"XRP\",\"ADA\",\"DOGE\",\"XLM\",\n \"USDT\",\"BUSD\",\"USDC\",\"DAI\",\"DOT\",\"AVAX\",\"LINK\",\n \"MATIC\",\"SHIB\",\"LTC\",\"FTT\",\"UNI\",\"XMR\",\"XAUT\",\n}\n\nBULLISH_KW = [\"surge\",\"rally\",\"breakout\",\"bullish\",\"all-time high\",\"soar\",\n \"gain\",\"rise\",\"adoption\",\"buy\",\"upgrade\",\"etf\",\"institutional\",\n \"launch\",\"positive\",\"record\",\"climb\",\"high\",\"profit\",\"inflow\"]\nBEARISH_KW = [\"crash\",\"plunge\",\"bearish\",\"sell\",\"hack\",\"scam\",\"ban\",\"regulation\",\n \"risk\",\"crackdown\",\"collapse\",\"fear\",\"drop\",\"warn\",\"investigation\",\n \"security\",\"breach\",\"exploit\",\"tumble\",\"slide\",\"slump\",\"death\",\n \"loss\",\"theft\",\"seize\",\"liquidat\",\"exploit\",\"exploit\"]\n\nRSS_FEEDS = [\n (\"CoinTelegraph\", \"https://cointelegraph.com/rss\"),\n (\"CoinDesk\", \"https://www.coindesk.com/arc/outboundfeeds/rss/\"),\n]\n\n# ============ 数据源1: Fear & Greed ============\ndef fetch_fear_greed():\n try:\n req = urllib.request.Request(\"https://api.alternative.me/fng/?limit=1\", headers=HEADERS)\n with urllib.request.urlopen(req, timeout=8) as r:\n data = json.loads(r.read())\n item = data.get(\"data\", [{}])[0]\n return {\"value\": int(item.get(\"value\", 0)), \"label\": item.get(\"value_classification\", \"?\")}\n except Exception as e:\n return {\"value\": None, \"label\": \"UNKNOWN\", \"error\": str(e)}\n\n# ============ 数据源2: Binance Ticker ============\ndef fetch_binance_ticker(coin=\"BTCUSDT\"):\n try:\n url = f\"https://data-api.binance.vision/api/v3/ticker/24hr?symbol={coin}\"\n req = urllib.request.Request(url, headers=HEADERS)\n with urllib.request.urlopen(req, timeout=8) as r:\n d = json.loads(r.read())\n return {\n \"lastPrice\": float(d.get(\"lastPrice\", 0)),\n \"changePct\": float(d.get(\"priceChangePercent\", 0)),\n \"highPrice\": float(d.get(\"highPrice\", 0)),\n \"lowPrice\": float(d.get(\"lowPrice\", 0)),\n \"quoteVolume\": float(d.get(\"quoteVolume\", 0)),\n }\n except:\n return {}\n\n# ============ 数据源3: 新闻情绪 ============\ndef fetch_news_sentiment():\n import xml.etree.ElementTree as ET\n all_news = []\n\n def get_text(el):\n if el is None: return \"\"\n txt = el.text if isinstance(el.text, str) else \"\"\n if not txt.strip():\n txt = \"\".join(el.itertext())\n return re.sub(r\"\\s+\", \" \", txt).strip()\n\n for name, url in RSS_FEEDS:\n try:\n req = urllib.request.Request(url, headers=HEADERS)\n with urllib.request.urlopen(req, timeout=10) as r:\n root = ET.fromstring(r.read())\n for item in root.iter(\"item\"):\n title = get_text(item.find(\"title\"))\n if not title or len(title) \u003c 5:\n title = get_text(item.find(\"description\"))\n if title and len(title) > 5:\n all_news.append(title)\n except Exception as e:\n print(f\" ⚠️ {name} RSS failed: {e}\", flush=True)\n\n b = be = ne = 0\n for title in all_news:\n t = title.lower()\n bv = sum(1 for kw in BULLISH_KW if kw in t)\n bev = sum(1 for kw in BEARISH_KW if kw in t)\n if bev > bv: be += 1\n elif bv > bev: b += 1\n else: ne += 1\n total = b + be + ne\n signal = \"NEUTRAL\"\n if b > be * 1.5: signal = \"BULLISH\"\n elif be > b * 1.5: signal = \"BEARISH\"\n return {\n \"signal\": signal, \"bullish\": b, \"bearish\": be, \"neutral\": ne,\n \"total\": total,\n \"bullish_pct\": round(b/total*100, 1) if total else 0,\n \"bearish_pct\": round(be/total*100, 1) if total else 0,\n }\n\n# ============ 数据源4: Browser快照解析 ============\ndef parse_browser_snapshot(text: str) -> dict:\n result = {\"hot_search_coins\": [], \"post_sentiment\": {\"bullish\": 0, \"bearish\": 0, \"neutral\": 0}, \"large_pnl_posts\": []}\n\n # 热搜币\n for coin, is_hot, price_str, change_str in re.findall(\n r'link\\s+\"([A-Z]{2,15})\\s+[A-Z]+\\s*(热度上升)?\\s*([\\d.,]+)?\\s*([+-]?\\d+\\.\\d+)?%\"', text):\n if coin in EXCLUDED_COINS: continue\n try:\n price = float(price_str.replace(\",\",\"\")) if price_str and price_str not in (\"--\",\"\") else None\n change = float(change_str) if change_str and change_str not in (\"--\",\"\") else None\n except: price = change = None\n result[\"hot_search_coins\"].append({\"coin\": coin, \"price\": price, \"change_pct\": change, \"is_hot\": bool(is_hot)})\n\n # 帖子情绪\n b = be = ne = 0\n for pt in re.findall(r'^\\s*- text:\\s*(.+?)\\s*

🟡 Binance 热度猎杀 Skill v2.0 整合多数据源(0 浏览器依赖)→ 统一交易信号 数据源:Fear&Greed API + 新闻 RSS + Binance Ticker + (可选) Browser快照 --- 核心脚本 --- 使用方式 推荐:快速模式(无需浏览器) 输出示例 : --- 数据源说明 | 数据 | 来源 | 依赖 | |------|------|------| | 恐惧贪婪指数 | Alternative.me API | ✅ 纯API | | 新闻情绪 | CoinTelegraph + CoinDesk RSS | ✅ 纯API | | BTC/ETH价格 | Binance data-api | ✅ 纯API | | 热搜币排行 | Binance Square 页面 | ⚠️ Browser | | 帖子盈亏 | Binance Square 页面 | ⚠️ Browser | Browser 数据为补充 ,核心信号完全无需浏览器。 --- 信号规则 | 条件 | 信号 | 操作 | |------|------|------| | BTC<-1.5% + 新闻偏空 | 🔴 BEARISH | 检查BTC below YES | | BTC<-4% + 极度恐惧 | 🟢 HIGH | 观察BTC above抄底 | | BTC…

, text, re.MULTILINE):\n bv = sum(1 for kw in BULLISH_KW if kw in pt)\n bev = sum(1 for kw in BEARISH_KW if kw in pt)\n if bev > bv: be += 1\n elif bv > bev: b += 1\n else: ne += 1\n pnl_m = re.search(r'未实现盈亏\\s*([+-])?([\\d,]+\\.?\\d*)', pt)\n if pnl_m:\n try:\n val = float(pnl_m.group(2).replace(\",\",\"\"))\n val = -val if pnl_m.group(1) == \"-\" else val\n if abs(val) > 1000:\n result[\"large_pnl_posts\"].append({\"pnl\": val, \"text\": pt[:60]})\n except: pass\n result[\"post_sentiment\"] = {\"bullish\": b, \"bearish\": be, \"neutral\": ne}\n return result\n\n# ============ 主分析引擎 ============\ndef analyze(fg, btc, eth, news, square):\n fg_val = fg.get(\"value\")\n btc_chg = btc.get(\"changePct\", 0)\n eth_chg = eth.get(\"changePct\", 0)\n\n if fg_val is not None:\n if fg_val >= 70: mood = \"极度贪婪\"\n elif fg_val >= 55: mood = \"贪婪\"\n elif fg_val >= 45: mood = \"中性\"\n elif fg_val >= 25: mood = \"恐惧\"\n else: mood = \"极度恐惧\"\n else: mood = \"UNKNOWN\"\n\n signals = []\n # 信号1: BTC下跌+新闻偏空 → 检查做空\n if btc_chg \u003c -1.5 and news[\"signal\"] == \"BEARISH\":\n signals.append({\"type\": \"BEARISH\", \"edge\": \"MEDIUM\", \"reason\": f\"BTC {btc_chg:+.1f}%+新闻偏空\", \"action\": \"检查BTC below YES\"})\n # 信号2: BTC急跌+极度恐惧 → 抄底观察\n if btc_chg \u003c -4 and fg_val and fg_val \u003c 30:\n signals.append({\"type\": \"BUY_BOTTOM\", \"edge\": \"HIGH\", \"reason\": f\"BTC急跌{btc_chg:+.1f}%+极度恐惧\", \"action\": \"观察BTC above YES机会\"})\n # 信号3: BTC强势+极度贪婪 → 警惕\n if btc_chg > 2 and fg_val and fg_val > 75:\n signals.append({\"type\": \"CAUTION\", \"edge\": \"MEDIUM\", \"reason\": f\"BTC强势{btc_chg:+.1f}%+极度贪婪\", \"action\": \"减少多头仓位\"})\n # 信号4: ETH急跌+恐惧 → 检查ETH below\n if eth_chg \u003c -4:\n signals.append({\"type\": \"ETH_DROP\", \"edge\": \"MEDIUM\", \"reason\": f\"ETH急跌{eth_chg:+.1f}%\", \"action\": \"检查ETH below YES\"})\n\n hot = []\n if square:\n for c in square.get(\"hot_search_coins\", []):\n if c.get(\"is_hot\") and c.get(\"change_pct\"):\n hot.append(f\"{c['coin']}{c['change_pct']:+.0f}%🔥\" if c[\"change_pct\"] > 0 else f\"{c['coin']}{c['change_pct']:+.0f}%📉\")\n\n whales = []\n if square:\n for p in square.get(\"large_pnl_posts\", [])[:3]:\n whales.append(f\"${p['pnl']:+,.0f} {'做空' if p['pnl'] > 0 else '做多亏损'}\")\n\n return {\n \"scan_time\": datetime.now(timezone(timedelta(hours=8))).strftime(\"%Y-%m-%d %H:%M:%S\"),\n \"fear_greed\": fg,\n \"market_mood\": mood,\n \"btc\": {\"price\": btc.get(\"lastPrice\"), \"change_pct\": btc_chg},\n \"eth\": {\"price\": eth.get(\"lastPrice\"), \"change_pct\": eth_chg},\n \"news\": news,\n \"signals\": signals,\n \"hot_opportunities\": hot[:5],\n \"whale_actions\": whales,\n }\n\n# ============ 主程序 ============\ndef main():\n args = argparse.ArgumentParser(description=\"热度猎杀整合\").parse_args()\n print(\"🔍 数据采集中...\", flush=True)\n\n with ThreadPoolExecutor(max_workers=5) as ex:\n fg_f = ex.submit(fetch_fear_greed)\n news_f = ex.submit(fetch_news_sentiment)\n btc_f = ex.submit(fetch_binance_ticker, \"BTCUSDT\")\n eth_f = ex.submit(fetch_binance_ticker, \"ETHUSDT\")\n\n fg = fg_f.result()\n news = news_f.result()\n btc = btc_f.result()\n eth = eth_f.result()\n\n square = None\n snap_path = \"/tmp/binance_square_snapshot.txt\"\n if os.path.exists(snap_path) and os.path.getsize(snap_path) > 500:\n try:\n with open(snap_path, encoding=\"utf-8\") as f:\n text = f.read()\n square = parse_browser_snapshot(text)\n print(f\"✅ Browser快照: {len(square['hot_search_coins'])}个热搜币\", flush=True)\n except Exception as e:\n print(f\"⚠️ Snapshot解析失败: {e}\", flush=True)\n\n result = analyze(fg, btc, eth, news, square)\n fg_v = result[\"fear_greed\"].get(\"value\")\n emoji = \"😱\" if fg_v and fg_v \u003c 45 else \"😈\" if fg_v and fg_v > 55 else \"😐\"\n\n print(f\"\\n{'='*60}\", flush=True)\n print(f\"📊 热度猎杀整合 | {result['scan_time']}\", flush=True)\n print(f\"{emoji} 恐惧贪婪: {fg_v} ({result['fear_greed'].get('label','?')}) | {result['market_mood']}\", flush=True)\n print(f\"₿ BTC: ${result['btc']['price']:,.0f} {result['btc']['change_pct']:+.2f}%\", flush=True)\n print(f\"Ξ ETH: ${result['eth']['price']:,.0f} {result['eth']['change_pct']:+.2f}%\", flush=True)\n print(f\"📰 新闻: {result['news']['signal']} ({result['news']['bullish']}多/{result['news']['bearish']}空)\", flush=True)\n\n if result[\"hot_opportunities\"]:\n print(f\"\\n🔥 热搜机会: {' | '.join(result['hot_opportunities'])}\", flush=True)\n if result[\"whale_actions\"]:\n print(f\"\\n🐋 大户动态: {' | '.join(result['whale_actions'])}\", flush=True)\n if result[\"signals\"]:\n print(f\"\\n📋 信号:\", flush=True)\n for s in result[\"signals\"]:\n flag = \"🟢\" if \"BUY\" in s[\"type\"] else \"🔴\" if \"BEARISH\" in s[\"type\"] else \"⚠️\"\n print(f\" {flag} [{s['edge']}] {s['reason']}\", flush=True)\n print(f\" → {s['action']}\", flush=True)\n else:\n print(f\"\\n📋 信号: 无特殊信号,等待机会\", flush=True)\n print(f\"{'='*60}\", flush=True)\n\n with open(\"/tmp/hunt_signals.json\", \"w\", encoding=\"utf-8\") as f:\n json.dump(result, f, ensure_ascii=False, indent=2)\n print(f\"✅ JSON: /tmp/hunt_signals.json\", flush=True)\n\n\nif __name__ == \"__main__\":\n main()\n","content_type":"text/x-python; charset=utf-8","language":"python","size":11118,"content_sha256":"75fd4dd46abab57d49cc3f17558920a2a44e3be807e9c74e77950d904cf40c2e"},{"filename":"scripts/scrape_binance_hot.py","content":"#!/usr/bin/env python3\n\"\"\"\nBinance 热度抓取 v1.0\n抓取 Binance 官方页面热门数据 → 热点币排行\n\"\"\"\nimport os\nimport sys\nimport json\nimport re\nimport urllib.request\nimport urllib.error\nfrom urllib.parse import urlencode\n\n# 清除代理\nfor k in ['http_proxy', 'https_proxy', 'HTTP_PROXY', 'HTTPS_PROXY', 'all_proxy', 'ALL_PROXY']:\n os.environ.pop(k, None)\n\nHEADERS = {\n \"User-Agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36\",\n \"Accept\": \"application/json, text/plain, */*\",\n \"Accept-Language\": \"en-US,en;q=0.9\",\n \"Referer\": \"https://www.binance.com/\",\n}\n\nBASE = \"https://data-api.binance.vision/api/v3\"\n\n\ndef fetch_json(url, params=None):\n if params:\n url += \"?\" + urlencode(params)\n req = urllib.request.Request(url, headers=HEADERS)\n try:\n with urllib.request.urlopen(req, timeout=10) as r:\n return json.loads(r.read())\n except Exception as e:\n return {\"error\": str(e)}\n\n\ndef get_all_tickers():\n \"\"\"获取所有 USDT 交易对的 24h 数据\"\"\"\n return fetch_json(f\"{BASE}/ticker/24hr\")\n\n\ndef filter_usdt_pairs(tickers):\n \"\"\"只保留 USDT 交易对,排除小币\"\"\"\n result = []\n for t in tickers:\n sym = t.get(\"symbol\", \"\")\n if not sym.endswith(\"USDT\"):\n continue\n # 过滤小币:成交量 > $1M\n try:\n vol = float(t.get(\"quoteVolume\", 0))\n if vol \u003c 1_000_000:\n continue\n result.append(t)\n except:\n continue\n return result\n\n\ndef get_top_movers(tickers, n=20):\n \"\"\"按涨幅排序,返回 Top 涨/跌\"\"\"\n try:\n sorted_tickers = sorted(tickers, key=lambda x: float(x.get(\"priceChangePercent\", 0) or 0), reverse=True)\n gainers = sorted_tickers[:n]\n losers = sorted_tickers[-n:][::-1]\n return gainers, losers\n except Exception as e:\n return [], []\n\n\ndef get_top_volume(tickers, n=20):\n \"\"\"按成交额排序\"\"\"\n try:\n return sorted(tickers, key=lambda x: float(x.get(\"quoteVolume\", 0) or 0), reverse=True)[:n]\n except:\n return []\n\n\ndef extract_coin(ticker):\n \"\"\"从 symbol 提取币种名\"\"\"\n sym = ticker.get(\"symbol\", \"\")\n return sym.replace(\"USDT\", \"\").replace(\"BUSD\", \"\").replace(\"USD\", \"\")\n\n\ndef format_ticker(t, rank=None):\n sym = t.get(\"symbol\", \"\")\n try:\n price = float(t.get(\"lastPrice\", 0))\n change = float(t.get(\"priceChangePercent\", 0))\n vol = float(t.get(\"quoteVolume\", 0))\n vol_str = f\"${vol/1e6:.1f}M\" if vol \u003c 1e9 else f\"${vol/1e9:.2f}B\"\n high = float(t.get(\"highPrice\", 0))\n low = float(t.get(\"lowPrice\", 0))\n coin = extract_coin(t)\n rank_str = f\"#{rank} \" if rank else \"\"\n return {\n \"rank\": rank,\n \"symbol\": sym,\n \"coin\": coin,\n \"price\": round(price, 6 if price \u003c 1 else 2),\n \"change_pct\": round(change, 2),\n \"quote_volume_usd\": round(vol, 0),\n \"vol_str\": vol_str,\n \"high_24h\": round(high, 6 if high \u003c 1 else 2),\n \"low_24h\": round(low, 6 if low \u003c 1 else 2),\n \"is_gain\": change > 0,\n }\n except:\n return {}\n\n\ndef main():\n print(\"🔍 抓取 Binance 热度数据...\", flush=True)\n\n tickers = get_all_tickers()\n if isinstance(tickers, dict) and \"error\" in tickers:\n print(f\"❌ API 失败: {tickers['error']}\")\n return\n\n pairs = filter_usdt_pairs(tickers)\n print(f\"📊 筛选后 USDT 交易对: {len(pairs)} 个\", flush=True)\n\n gainers, losers = get_top_movers(pairs, n=20)\n top_vol = get_top_volume(pairs, n=20)\n\n # 按交易额计算体积倍数\n btc_ticker = next((t for t in pairs if t.get(\"symbol\") == \"BTCUSDT\"), None)\n btc_vol = float(btc_ticker.get(\"quoteVolume\", 1)) if btc_ticker else 1\n\n result = {\n \"scan_time\": \"\",\n \"total_pairs\": len(pairs),\n \"gainers\": [],\n \"losers\": [],\n \"top_volume\": [],\n \"hot_coins\": [], # 热点币(涨幅>3% 且成交额>BTC的10%)\n }\n\n for i, t in enumerate(gainers):\n formatted = format_ticker(t, rank=i + 1)\n result[\"gainers\"].append(formatted)\n\n for i, t in enumerate(losers):\n formatted = format_ticker(t, rank=i + 1)\n result[\"losers\"].append(formatted)\n\n for i, t in enumerate(top_vol):\n formatted = format_ticker(t, rank=i + 1)\n result[\"top_volume\"].append(formatted)\n\n # 热点币过滤:涨幅>3% 或 成交量>BTC的20%\n vol_threshold = btc_vol * 0.20\n for t in pairs:\n try:\n change = float(t.get(\"priceChangePercent\", 0) or 0)\n vol = float(t.get(\"quoteVolume\", 0) or 0)\n if change > 3.0 or (change > 1.0 and vol > vol_threshold):\n formatted = format_ticker(t)\n if formatted[\"coin\"] not in [c[\"coin\"] for c in result[\"hot_coins\"]]:\n result[\"hot_coins\"].append(formatted)\n except:\n continue\n\n # 按涨幅排序热点币\n result[\"hot_coins\"].sort(key=lambda x: x[\"change_pct\"], reverse=True)\n\n # 打印摘要\n print(f\"\\n{'='*50}\", flush=True)\n print(f\"🔥 热点币 (涨幅>3%): {len([c for c in result['hot_coins'] if c['change_pct'] > 3])} 个\", flush=True)\n for c in result[\"hot_coins\"][:10]:\n flag = \"📈\" if c[\"is_gain\"] else \"📉\"\n print(f\" {flag} {c['coin']:8s} {c['change_pct']:+.2f}% | {c['vol_str']:>10s} | ${c['price']}\", flush=True)\n\n print(f\"\\n📈 涨幅榜 Top10:\", flush=True)\n for c in result[\"gainers\"][:10]:\n print(f\" #{c['rank']:2d} {c['coin']:8s} {c['change_pct']:+.2f}% | {c['vol_str']:>10s}\", flush=True)\n\n print(f\"\\n📉 跌幅榜 Top10:\", flush=True)\n for c in result[\"losers\"][:10]:\n print(f\" #{c['rank']:2d} {c['coin']:8s} {c['change_pct']:+.2f}% | {c['vol_str']:>10s}\", flush=True)\n\n print(f\"\\n💧 成交额 Top10:\", flush=True)\n for c in result[\"top_volume\"][:10]:\n print(f\" #{c['rank']:2d} {c['coin']:8s} {c['vol_str']:>10s} | {c['change_pct']:+.2f}%\", flush=True)\n print(f\"{'='*50}\", flush=True)\n\n # 输出 JSON 供后续处理\n output_file = \"/tmp/binance_hot.json\"\n with open(output_file, \"w\") as f:\n json.dump(result, f, indent=2)\n print(f\"\\n✅ JSON 已保存: {output_file}\", flush=True)\n\n # 输出可读摘要供 skill 读取\n hot_summary = f\"热点币 {len(result['hot_coins'])} 个 | 涨幅榜 #{result['gainers'][0]['coin'] if result['gainers'] else 'N/A'} +{result['gainers'][0]['change_pct'] if result['gainers'] else 0}% | 成交额 #1 {result['top_volume'][0]['coin'] if result['top_volume'] else 'N/A'}\"\n print(f\"\\n📋 Summary: {hot_summary}\", flush=True)\n\n\nif __name__ == \"__main__\":\n main()\n","content_type":"text/x-python; charset=utf-8","language":"python","size":6831,"content_sha256":"8a0ffb798328fa3e88895bf44cf578be5ae29d56044258076a7aacf98630a367"},{"filename":"scripts/scrape_news.py","content":"#!/usr/bin/env python3\n\"\"\"\n加密货币新闻爬虫 v1.0\n基于 RSS feeds,无需 API key\n\"\"\"\nimport os\nimport sys\nimport json\nimport re\nimport urllib.request\nimport xml.etree.ElementTree as ET\nfrom datetime import datetime, timezone, timedelta\nfrom concurrent.futures import ThreadPoolExecutor, as_completed\n\n# 清除所有代理\nfor k in list(os.environ.keys()):\n if 'proxy' in k.lower():\n del os.environ[k]\n\nHEADERS = {\n \"User-Agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36\",\n \"Accept\": \"application/rss+xml, application/xml, text/xml, */*\",\n}\n\nRSS_FEEDS = [\n (\"CoinTelegraph\", \"https://cointelegraph.com/rss\"),\n (\"CoinDesk\", \"https://www.coindesk.com/arc/outboundfeeds/rss/\"),\n (\"Bitcoinist\", \"https://bitcoinist.com/feed/\"),\n]\n\nBULLISH_KEYWORDS = [\n \"surge\", \"rally\", \"breakout\", \"bullish\", \"all-time high\", \"ath\",\n \"soar\", \"jump\", \"gain\", \"rise\", \"growth\", \"adoption\", \"buy\",\n \"support\", \"upgrade\", \"etf\", \"institutional\", \"launch\",\n \"positive\", \"optimistic\", \"record\", \"high\", \"climb\", \"bid\",\n]\n\nBEARISH_KEYWORDS = [\n \"crash\", \"plunge\", \"bearish\", \"sell\", \"hack\", \"scam\", \"ban\",\n \"regulation\", \"risk\", \"crackdown\", \"collapse\", \"fear\", \"drop\",\n \"warn\", \"investigation\", \"probe\", \"security\", \"breach\", \"exploit\",\n \"loses\", \"loss\", \"plunge\", \"tumble\", \"slide\", \"slump\", \"death\",\n]\n\n\ndef strip_tags(text):\n \"\"\"去除HTML标签\"\"\"\n if not text:\n return \"\"\n text = re.sub(r'\u003c[^>]+>', '', text)\n text = re.sub(r'&', '&', text)\n text = re.sub(r'<', '\u003c', text)\n text = re.sub(r'>', '>', text)\n text = re.sub(r'"', '\"', text)\n text = re.sub(r''', \"'\", text)\n text = re.sub(r' ', ' ', text)\n return text.strip()\n\n\ndef parse_rss_feed(url, name, timeout=10):\n \"\"\"解析单个RSS源\"\"\"\n req = urllib.request.Request(url, headers=HEADERS)\n try:\n with urllib.request.urlopen(req, timeout=timeout) as r:\n xml_data = r.read()\n root = ET.fromstring(xml_data)\n # 尝试多种RSS格式\n items = root.findall('.//item')\n if not items:\n items = root.findall('.//entry')\n if not items:\n # 尝试 Atom 格式\n items = root.findall('.//atom:entry', {'atom': 'http://www.w3.org/2005/Atom'})\n if not items:\n items = root.findall('.//{http://www.w3.org/2005/Atom}entry')\n\n news_list = []\n for item in items:\n title_el = item.find('title')\n desc_el = item.find('description') or item.find('summary') or item.find('content')\n link_el = item.find('link')\n date_el = item.find('pubDate') or item.find('published') or item.find('updated')\n\n title = strip_tags(title_el.text) if title_el is not None else \"\"\n desc = strip_tags(desc_el.text) if desc_el is not None else \"\"\n link = link_el.text if link_el is not None else (link_el.get('href') if isinstance(link_el, object) and hasattr(link_el, 'get') else \"\")\n\n if title:\n news_list.append({\n \"title\": title,\n \"body\": desc[:300],\n \"source\": name,\n \"url\": link,\n \"published\": date_el.text if date_el is not None else \"\",\n })\n return news_list\n except Exception as e:\n return []\n\n\ndef classify_sentiment(news_list):\n \"\"\"情绪分类\"\"\"\n bullish = bearish = neutral = 0\n btc_news = eth_news = 0\n\n for n in news_list:\n text = (n.get(\"title\", \"\") + \" \" + n.get(\"body\", \"\")).lower()\n\n # 统计关键词\n b_count = sum(1 for kw in BULLISH_KEYWORDS if kw in text)\n be_count = sum(1 for kw in BEARISH_KEYWORDS if kw in text)\n\n if be_count > b_count:\n bearish += 1\n elif b_count > be_count:\n bullish += 1\n else:\n neutral += 1\n\n # 币种统计\n if any(w in text for w in ['bitcoin', 'btc', 'satoshi']):\n btc_news += 1\n if any(w in text for w in ['ethereum', 'eth', 'ether']):\n eth_news += 1\n\n total = bullish + bearish + neutral\n if total == 0:\n return {\"bullish\": 0, \"bearish\": 0, \"neutral\": 0, \"signal\": \"NEUTRAL\", \"btc_count\": 0, \"eth_count\": 0}\n\n if bullish > bearish * 1.5:\n signal = \"BULLISH\"\n elif bearish > bullish * 1.5:\n signal = \"BEARISH\"\n else:\n signal = \"NEUTRAL\"\n\n return {\n \"bullish\": bullish,\n \"bearish\": bearish,\n \"neutral\": neutral,\n \"signal\": signal,\n \"bullish_pct\": round(bullish / total * 100, 1),\n \"bearish_pct\": round(bearish / total * 100, 1),\n \"btc_count\": btc_news,\n \"eth_count\": eth_news,\n }\n\n\ndef main():\n print(\"📰 抓取加密新闻 (RSS)...\", flush=True)\n\n all_news = []\n\n # 并行抓取所有源\n with ThreadPoolExecutor(max_workers=3) as executor:\n futures = {executor.submit(parse_rss_feed, url, name): name for name, url in RSS_FEEDS}\n for future in as_completed(futures):\n name = futures[future]\n try:\n news = future.result()\n all_news.extend(news)\n print(f\" ✅ {name}: {len(news)} 条\", flush=True)\n except Exception as e:\n print(f\" ❌ {name}: {e}\", flush=True)\n\n if not all_news:\n print(\"❌ 未能获取任何新闻\")\n return\n\n # 去重(按标题前50字符)\n seen = set()\n unique_news = []\n for n in all_news:\n key = n[\"title\"][:50].lower()\n if key and key not in seen:\n seen.add(key)\n unique_news.append(n)\n\n # 按时间排序(把有时间戳的排前面)\n unique_news.sort(key=lambda x: x.get(\"published\", \"\"), reverse=True)\n\n sentiment = classify_sentiment(unique_news)\n\n print(f\"\\n{'='*60}\", flush=True)\n print(f\"📊 情绪分析 ({len(unique_news)} 条,去重后)\", flush=True)\n print(f\" 🟢 看涨: {sentiment['bullish']} ({sentiment['bullish_pct']}%)\", flush=True)\n print(f\" 🔴 看跌: {sentiment['bearish']} ({sentiment['bearish_pct']}%)\", flush=True)\n print(f\" ⚪ 中性: {sentiment['neutral']}\", flush=True)\n print(f\" 📌 信号: {sentiment['signal']}\", flush=True)\n print(f\" ₿ BTC新闻: {sentiment['btc_count']}条 | Ξ ETH新闻: {sentiment['eth_count']}条\", flush=True)\n\n print(f\"\\n📰 最新新闻:\", flush=True)\n for n in unique_news[:8]:\n title = n[\"title\"][:60]\n src = n[\"source\"]\n pub = n.get(\"published\", \"\")[:16]\n print(f\" [{src:12s}] {title}...\", flush=True)\n\n # 来源统计\n sources = {}\n for n in unique_news:\n sources[n[\"source\"]] = sources.get(n[\"source\"], 0) + 1\n print(f\"\\n📡 来源: \" + \" | \".join(f\"{k}={v}\" for k, v in sorted(sources.items(), key=lambda x: x[1], reverse=True)), flush=True)\n print(f\"{'='*60}\", flush=True)\n\n # 输出JSON\n output = {\n \"scan_time\": datetime.now(timezone(timedelta(hours=8))).strftime(\"%Y-%m-%d %H:%M:%S\"),\n \"total\": len(unique_news),\n \"sentiment\": sentiment,\n \"news\": unique_news[:20],\n \"sources\": sources,\n }\n\n out_file = \"/tmp/crypto_news.json\"\n with open(out_file, \"w\", encoding=\"utf-8\") as f:\n json.dump(output, f, ensure_ascii=False, indent=2)\n print(f\"\\n✅ JSON: {out_file}\", flush=True)\n\n summary = f\"📰 {len(unique_news)}条新闻 | 信号:{sentiment['signal']} | 🟢{sentiment['bullish']} 🔴{sentiment['bearish']} ⚪{sentiment['neutral']}\"\n print(f\"📋 {summary}\", flush=True)\n\n\nif __name__ == \"__main__\":\n main()\n","content_type":"text/x-python; charset=utf-8","language":"python","size":7831,"content_sha256":"eb2fa56e4832bb7eca909a1a2c9d8957826a4723ccf003e64ceea014904db3ed"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"🟡 Binance 热度猎杀 Skill v2.0","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"整合多数据源(0 浏览器依赖)→ 统一交易信号","type":"text"}]},{"type":"paragraph","content":[{"text":"数据源:Fear&Greed API + 新闻 RSS + Binance Ticker + (可选) Browser快照","type":"text"}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"核心脚本","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"skills/binance-trending/scripts/\n├── scan_square_hunt.py # 整合主脚本(纯API,0浏览器依赖)\n├── scrape_square.py # Browser快照解析(补充数据)\n├── scrape_binance_hot.py # Binance热度(纯API)\n└── scrape_news.py # 新闻RSS(纯API)","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"使用方式","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"推荐:快速模式(无需浏览器)","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"python3 \"$SKILL_DIR/scripts/scan_square_hunt.py\"","type":"text"}]},{"type":"paragraph","content":[{"text":"输出示例","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"📊 热度猎杀整合 | 2026-04-23 22:34\n😐 恐惧贪婪: 46 (Fear) | 中性\n₿ BTC: $77,843 -1.18%\nΞ ETH: $2,329 -3.03%\n📰 新闻: BEARISH (9多/17空)\n\n🔥 热搜机会: BONK-2%📉 | JUP-5%📉 | CHIP-6%📉 | WLD-3%📉\n🐋 大户动态: $+70,386 做空 | $-14,026 做多亏损\n\n📋 信号:\n 🔴 [MEDIUM] BTC -1.2%+新闻偏空\n → 检查BTC below YES","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"数据源说明","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"数据","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"来源","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"依赖","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"恐惧贪婪指数","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Alternative.me API","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ 纯API","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"新闻情绪","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"CoinTelegraph + CoinDesk RSS","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ 纯API","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"BTC/ETH价格","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Binance data-api","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ 纯API","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"热搜币排行","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Binance Square 页面","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"⚠️ Browser","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"帖子盈亏","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Binance Square 页面","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"⚠️ Browser","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"Browser 数据为补充","type":"text","marks":[{"type":"strong"}]},{"text":",核心信号完全无需浏览器。","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"信号规则","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"条件","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"信号","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"操作","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"BTC\u003c-1.5% + 新闻偏空","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"🔴 BEARISH","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"检查BTC below YES","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"BTC\u003c-4% + 极度恐惧","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"🟢 HIGH","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"观察BTC above抄底","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"BTC>+2% + 极度贪婪","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"⚠️ CAUTION","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"减少多头","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"ETH\u003c-4%","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"🔴 ETH_DROP","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"检查ETH below YES","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"信号强度","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Edge","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"触发条件","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"HIGH","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"BTC急跌+极度恐惧 或 BTC强势+贪婪","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"MEDIUM","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"BTC下跌+新闻偏空 或 ETH急跌","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"完整 Cron 流程(无浏览器)","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"0,30 * * * * python3 $SKILL/scripts/scan_square_hunt.py","type":"text"}]},{"type":"paragraph","content":[{"text":"每30分钟自动运行,输出 ","type":"text"},{"text":"/tmp/hunt_signals.json","type":"text","marks":[{"type":"code_inline"}]},{"text":"。","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Browser 增强模式(可选)","type":"text"}]},{"type":"paragraph","content":[{"text":"每6小时运行一次,获取热搜+帖子数据:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# 1. 打开页面\nbrowser → open(url='https://www.binance.com/zh-CN/square/fear-and-greed-index')\n\n# 2. 等待加载\nbrowser → act(wait=6000ms)\n\n# 3. 保存snapshot\nbrowser → snapshot(compact=True) → 保存到 /tmp/binance_square_snapshot.txt\n\n# 4. 运行完整模式\npython3 $SKILL/scripts/scan_square_hunt.py --all","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"JSON 输出","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"json"},"content":[{"text":"{\n \"scan_time\": \"2026-04-23 22:34\",\n \"fear_greed\": {\"value\": 46, \"label\": \"Fear\"},\n \"market_mood\": \"中性\",\n \"btc\": {\"price\": 77843, \"change_pct\": -1.18},\n \"eth\": {\"price\": 2329, \"change_pct\": -3.03},\n \"news\": {\"signal\": \"BEARISH\", \"bullish\": 9, \"bearish\": 17},\n \"signals\": [{\"type\": \"BEARISH\", \"edge\": \"MEDIUM\", ...}],\n \"hot_opportunities\": [\"CHIP-6%📉\", \"BONK-2%📉\"],\n \"whale_actions\": [\"$+70,386 做空\", \"$-14,026 做多亏损\"]\n}","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"文件结构","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"skills/binance-trending/\n├── SKILL.md\n└── scripts/\n ├── scan_square_hunt.py # 整合主脚本\n ├── scrape_square.py # Browser快照解析\n ├── scrape_binance_hot.py # Binance热度(纯API)\n └── scrape_news.py # 新闻RSS","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"注意事项","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"推荐使用 ","type":"text","marks":[{"type":"strong"}]},{"text":"--fast","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" 模式","type":"text","marks":[{"type":"strong"}]},{"text":",0浏览器依赖,稳定可卡","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Browser 数据为补充,每6h更新一次足够","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"信号需结合 Polymarket 实际市场存在性判断","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"单笔交易 ≤ $5(热度策略高风险)","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","author":"@skillopedia","source":{"stars":65,"repo_name":"claude-code-skills","origin_url":"https://github.com/aaaaqwq/claude-code-skills/blob/HEAD/skills/binance-trending/SKILL.md","repo_owner":"aaaaqwq","body_sha256":"3e3261efbe92049ac1dd6d1951f82953ef9f4edb4b23a07ce3a9201f41aaab23","cluster_key":"b41cd61728d8dab8dfba0be70711e847fd119a2a38b265743b5b84c07274e388","clean_bundle":{"format":"clean-skill-bundle-v1","source":"aaaaqwq/claude-code-skills/skills/binance-trending/SKILL.md","attachments":[{"id":"c5754d0b-752f-52a3-bd03-f690eba8521f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c5754d0b-752f-52a3-bd03-f690eba8521f/attachment.py","path":"scripts/hunt_report.py","size":13785,"sha256":"1aa6f5bfa261c77542113be284f9aae501f4e8fcf1313dee7ab242327aa1778f","contentType":"text/x-python; charset=utf-8"},{"id":"85e67c5d-94d3-57fc-a3fc-68b2ba80abe4","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/85e67c5d-94d3-57fc-a3fc-68b2ba80abe4/attachment.py","path":"scripts/scan_square_hunt.py","size":11118,"sha256":"75fd4dd46abab57d49cc3f17558920a2a44e3be807e9c74e77950d904cf40c2e","contentType":"text/x-python; charset=utf-8"},{"id":"c3c58cfb-bbea-5a2a-9bea-d6206128c2d1","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c3c58cfb-bbea-5a2a-9bea-d6206128c2d1/attachment.py","path":"scripts/scrape_binance_hot.py","size":6831,"sha256":"8a0ffb798328fa3e88895bf44cf578be5ae29d56044258076a7aacf98630a367","contentType":"text/x-python; charset=utf-8"},{"id":"04cb758b-6ab8-594f-9970-15d68f212d7e","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/04cb758b-6ab8-594f-9970-15d68f212d7e/attachment.py","path":"scripts/scrape_news.py","size":7831,"sha256":"eb2fa56e4832bb7eca909a1a2c9d8957826a4723ccf003e64ceea014904db3ed","contentType":"text/x-python; charset=utf-8"}],"bundle_sha256":"002d931ee5e13079ca221915eda1a2a1e5fb78ac7d917fac3827f0ef8a299500","attachment_count":4,"text_attachments":4,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"skills/binance-trending/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"general","category_label":"General"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"general","import_tag":"clean-skills-v1"}},"renderedAt":1782980842081}

🟡 Binance 热度猎杀 Skill v2.0 整合多数据源(0 浏览器依赖)→ 统一交易信号 数据源:Fear&Greed API + 新闻 RSS + Binance Ticker + (可选) Browser快照 --- 核心脚本 --- 使用方式 推荐:快速模式(无需浏览器) 输出示例 : --- 数据源说明 | 数据 | 来源 | 依赖 | |------|------|------| | 恐惧贪婪指数 | Alternative.me API | ✅ 纯API | | 新闻情绪 | CoinTelegraph + CoinDesk RSS | ✅ 纯API | | BTC/ETH价格 | Binance data-api | ✅ 纯API | | 热搜币排行 | Binance Square 页面 | ⚠️ Browser | | 帖子盈亏 | Binance Square 页面 | ⚠️ Browser | Browser 数据为补充 ,核心信号完全无需浏览器。 --- 信号规则 | 条件 | 信号 | 操作 | |------|------|------| | BTC<-1.5% + 新闻偏空 | 🔴 BEARISH | 检查BTC below YES | | BTC<-4% + 极度恐惧 | 🟢 HIGH | 观察BTC above抄底 | | BTC…