google-trends-ath-detector
npx skills add https://github.com/fatfingererr/macro-skills --skill google-trends-ath-detector
Agent 安装分布
Skill 文档
<essential_principles> Google Trends ATH Detector æ ¸å¿åå
1. 模æ¬ç人ç覽å¨è¡çºæå Google Trends
æ¬æè½ä½¿ç¨ Selenium 模æ¬ç人ç覽å¨ï¼
- ç§»é¤
navigator.webdriverèªååæ¨è¨ - 鍿©è¼ªæ User-Agentï¼Chrome/Firefox/Safariï¼
- è«æ±é鍿©å»¶é²ï¼0.5-2 ç§ï¼
- å 訪åé¦é å»ºç« sessionï¼åæåæ¸æ
2. è¨èååï¼Signal Typingï¼
æå°è¶¨å¢é£ååçºä¸ç¨®é¡åï¼
| é¡å | ç¹å¾µ | è§£è® |
|---|---|---|
| Seasonal spike | æ¯å¹´åºå®æä»½éè¤ | å¶åº¦æ§é±æï¼æä¿å£ãå ±ç¨ å£ï¼ |
| Event-driven shock | çæå°å³°ãz-score é« | æ°è/æ¿ç/çªç¼äºä»¶ |
| Regime shift | 趨å¢ç·ä¸ç§»ãæçºé«ä½ | çµæ§æ§é注ä¸å |
3. åæå ¬å¼
ATH å¤å®ï¼latest_value >= max(history) * 0.98
ç°å¸¸å¤å®ï¼zscore >= threshold (default: 2.5)
è¨èååï¼based on (is_ath, is_anomaly, trend_direction)
4. æè¿°æ§åæåªå
æ¬æè½æä¾å®¢è§çæ¸å¸åæçµæï¼
- 輸åºè¨èé¡åãç°å¸¸åæ¸çéåææ¨
- æå related queries ä½çºé© åå ç´ åè
- ç±ç¨æ¶æ ¹æå°æ¥ç¥èèªè¡è§£è® </essential_principles>
- Detect – å¿«é嵿¸¬æ¯å¦åµä¸ ATH æåºç¾ç°å¸¸
- Analyze – 深度åæè¨èé¡åèé© åå ç´
- Compare – æ¯è¼å¤å主é¡ç趨å¢å ±æ¯
çå¾ åæå¾åç¹¼çºã
è®å工使µç¨å¾ï¼è«å®å ¨éµå¾ªå ¶æ¥é©ã
<reference_index>
åèæä»¶ (references/)
| æä»¶ | å §å®¹ |
|---|---|
| input-schema.md | 宿´è¼¸å ¥åæ¸å®ç¾©èé è¨å¼ |
| data-sources.md | Google Trends æ¸æä¾æºè Selenium ç¬åæå |
| signal-types.md | è¨èååå®ç¾©èå¤å®é輯 |
| seasonality-guide.md | å£ç¯æ§åè§£æ¹æ³èè§£è® |
| </reference_index> |
<workflows_index>
| Workflow | Purpose |
|---|---|
| detect.md | å¿«é嵿¸¬ ATH èç°å¸¸åæ¸ |
| analyze.md | 深度åæãè¨èååãé© åè©å½ |
| compare.md | å¤ä¸»é¡è¶¨å¢å ±æ¯åæ |
| </workflows_index> |
<templates_index>
| Template | Purpose |
|---|---|
| output-schema.yaml | æ¨æºè¼¸åº JSON schema |
| </templates_index> |
<scripts_index>
| Script | Purpose |
|---|---|
| trend_fetcher.py | æ ¸å¿ç¬è²èåæé輯ï¼Selenium çï¼ |
| </scripts_index> |
<examples_index>
ç¯ä¾è¼¸åº (examples/)
| æä»¶ | å §å®¹ |
|---|---|
| health_insurance_ath.json | Health Insurance ATH 嵿¸¬ç¯ä¾ |
| seasonal_vs_anomaly.json | å£ç¯æ§ vs ç°å¸¸å¤å®ç¯ä¾ |
| multi_topic_comparison.json | å¤ä¸»é¡æ¯è¼ç¯ä¾ |
| </examples_index> |
<quick_start> å¿«ééå§ï¼å®è£ä¾è³´
pip install selenium webdriver-manager beautifulsoup4 lxml loguru
Python APIï¼
from scripts.trend_fetcher import fetch_trends, analyze_ath
# æåæ¸æï¼ä½¿ç¨ Selenium 模æ¬ç覽å¨ï¼
data = fetch_trends(
topic="Health Insurance",
geo="US",
timeframe="2004-01-01 2025-12-31"
)
# ATH åæ
result = analyze_ath(data, threshold=2.5)
print(f"Is ATH: {result['analysis']['is_all_time_high']}")
print(f"Signal Type: {result['analysis']['signal_type']}")
print(f"Z-Score: {result['analysis']['zscore']}")
CLI å¿«ééå§ï¼
# åºæ¬åæ
python scripts/trend_fetcher.py \
--topic "Health Insurance" \
--geo US \
--output ./output/health_insurance.json
# æ¯è¼å¤å主é¡
python scripts/trend_fetcher.py \
--topic "Health Insurance" \
--compare "Unemployment,Inflation" \
--geo US \
--output ./output/comparison.json
# è·³é related queriesï¼æ´å¿«ãæ´å°è«æ±ï¼
python scripts/trend_fetcher.py \
--topic "Health Insurance" \
--no-related \
--output ./output/health_insurance.json
# Debug 模å¼ï¼é¡¯ç¤ºç覽å¨ãä¿å HTMLï¼
python scripts/trend_fetcher.py \
--topic "Health Insurance" \
--debug \
--no-headless
# ç»å
¥æ¨¡å¼ï¼é è¨çå¾
120 ç§ä¾ 2FA é©èï¼
python scripts/trend_fetcher.py \
--topic "Health Insurance" \
--output ./output/health_insurance.json
# è·³éç»å
¥çå¾
ï¼ä¸éè¦ç»å
¥æï¼
python scripts/trend_fetcher.py \
--topic "Health Insurance" \
--login-wait 0 \
--output ./output/health_insurance.json
# å¾å·²ä¸è¼ç CSV æªæ¡åæï¼è·³éçè¦½å¨æåï¼
python scripts/trend_fetcher.py \
--topic "Health Insurance" \
--csv ./downloads/multiTimeline.csv \
--output ./output/health_insurance.json
# èªåå¾ Downloads ç®éæ¾ææ° CSV
python scripts/trend_fetcher.py \
--topic "Health Insurance" \
--csv auto \
--output ./output/health_insurance.json
CLI åæ¸èªªæï¼
| 忏 | 說æ | é è¨å¼ |
|---|---|---|
--topic |
æå°ä¸»é¡ï¼å¿ è¦ï¼ | – |
--geo |
å°å代碼 | US |
--timeframe |
æéç¯å | 2004-01-01 2025-12-31 |
--threshold |
ç°å¸¸ z-score éæª» | 2.5 |
--compare |
æ¯è¼ä¸»é¡ï¼éèåéï¼ | – |
--no-related |
è·³é related queries | false |
--no-headless |
顯示ç覽å¨è¦çª | false |
--login |
å¼·å¶åç¨ç»å ¥æ¨¡å¼ | false |
--login-wait |
ç»å ¥çå¾ ç§æ¸ï¼0=äºåå¼ Enterï¼ | 120 |
--csv |
CSV æªæ¡è·¯å¾æ ‘auto’ èªåå°æ¾ | – |
--debug |
åç¨èª¿è©¦æ¨¡å¼ | false |
--output |
è¼¸åº JSON æªæ¡è·¯å¾ | – |
| </quick_start> |
<success_criteria> Skill æåå·è¡æï¼
- Selenium æååå並模æ¬ç覽å¨
- æ£ç¢ºæå Google Trends æéåºå
- å¤å® ATH çæ èç°å¸¸åæ¸
- èå¥è¨èé¡åï¼seasonal/event/regimeï¼
- æå related queries é© åè©å½ï¼è¥åç¨ï¼
- 輸åºçµæ§å JSON çµæ </success_criteria>
<anti_detection_strategy> é²åµæ¸¬çç¥æè¦
æ¬æè½å¯¦ç¾ä»¥ä¸é²åµæ¸¬æªæ½ï¼åºæ¼ design-human-like-crawler.mdï¼ï¼
| çç¥ | ææ | åªå ç´ |
|---|---|---|
ç§»é¤ navigator.webdriver |
æ ¸å¿ï¼é²æ¢ JS 嵿¸¬ | ð´ å¿ è¦ |
| 鍿© User-Agent | é¿å åºå® UA 被èå¥ | ð´ å¿ è¦ |
| è«æ±å鍿©å»¶é² | 模æ¬äººé¡è¡çº | ð´ å¿ è¦ |
| ç¦ç¨èªååæ´å± | ç§»é¤ Chrome çè·¡ | ð¡ å»ºè° |
| å 訪åé¦é å API | å»ºç«æ£å¸¸ session | ð¡ å»ºè° |
Chrome é¸é é ç½®ï¼
chrome_options.add_argument('--disable-blink-features=AutomationControlled')
chrome_options.add_experimental_option('excludeSwitches', ['enable-automation'])
chrome_options.add_experimental_option('useAutomationExtension', False)
</anti_detection_strategy>