{"skill":{"slug":"cnbc-geopolitics-fetcher","displayName":"Cnbc Geopolitics Fetcher","summary":"Automated geopolitical intelligence agent that fetches 5 hottest CNBC news articles from last 24 hours, extracts structured data (Title, URL, Market Impact,...","description":"# CNBC Geopolitics Fetcher Skill\n\n## Purpose\nFetches latest CNBC geopolitical news articles, extracts complete factual data (NO truncation), and posts each article individually to Discord with enhanced analyst/Polymarket-relevant context.\n\n## What This Skill Does\n1. **Scrapes** 5 latest CNBC articles on geopolitics (Iran, Middle East, oil markets, energy policy)\n2. **Extracts** complete sentences - NO truncation or summarization\n3. **Identifies** analyst forecasts and Polymarket-relevant data (odds, probabilities, market pricing)\n4. **Posts** each article as a separate Discord message (1-by-1, not batched)\n5. **Auto-splits** long messages to fit Discord's 2000-character limit\n\n---\n\n## Quick Start (One Command)\nRun this from workspace root:\n\n```powershell\npython \"C:\\Users\\Legion 5i Pro\\.openclaw\\workspace\\skills\\cnbc-geopolitics-fetcher\\scripts\\fetch_cnbc_geopolitics.py\" --webhook \"YOUR_DISCORD_WEBHOOK_URL\" --verbose\n```\n\n### Required Arguments\n- `--webhook`: Discord webhook URL (required)\n- `--config`: Path to config file containing webhook (alternative to --webhook)\n- `--count`: Number of articles to fetch (default: 5)\n- `--verbose`: Show detailed extraction output\n\n### Example (Full Command)\n```powershell\npython \"C:\\Users\\Legion 5i Pro\\.openclaw\\workspace\\skills\\cnbc-geopolitics-fetcher\\scripts\\fetch_cnbc_geopolitics.py\" --webhook \"https://discord.com/api/webhooks/1482043765471445333/-cHOLCqBtvU_Wua8STfoINes7J0pFNFsXB27EJ3f8F7BklC5P_OkIGAx2HQLDPZe1bNJ\" --count 5 --verbose\n```\n\n---\n\n## Configuration\n\n### Option 1: Command-Line Webhook\nPass webhook URL directly:\n```powershell\npython fetch_cnbc_geopolitics.py --webhook \"https://discord.com/api/webhooks/...\"\n```\n\n### Option 2: Config File\nCreate `references/config.md` with:\n```markdown\n## Discord Webhook\nhttps://discord.com/api/webhooks/1482043765471445333/-cHOLCqBtvU_Wua8STfoINes7J0pFNFsXB27EJ3f8F7BklC5P_OkIGAx2HQLDPZe1bNJ\n```\n\nThen run:\n```powershell\npython fetch_cnbc_geopolitics.py --config \"C:\\Users\\Legion 5i Pro\\.openclaw\\workspace\\skills\\cnbc-geopolitics-fetcher\\references\\config.md\"\n```\n\n---\n\n## Output Format (Discord Message)\n\nEach article posts as:\n\n```markdown\n### Article\n\n**[Full Article Title]**\n\n**URL:** https://www.cnbc.com/2026/03/13/...\n\n**Market Impact:** Energy: [complete sentence about oil/energy]; Stocks: [complete sentence about markets]; Analyst: [forecast/prediction]\n\n**Hard Facts:**\n  - Official: [complete quoted statement from official]\n  - Action: [complete sentence describing military/diplomatic action]\n  - Data: [complete sentence with numbers/statistics]\n  - Timeline: [complete sentence with dates/deadlines]\n  - Analyst: [complete sentence with forecast/market prediction]\n\n*(Raw data - no editorial analysis)*\n```\n\n### Key Features\n- **Complete sentences** - NO truncation (removed all length limits)\n- **Analyst/Polymarket data** - extracts forecasts, odds, probabilities, market pricing\n- **One-by-one posting** - each article is a separate Discord message\n- **Auto-split** - messages >2000 chars split into parts automatically\n\n---\n\n## How It Works (Architecture)\n\n### 1. Article Discovery\n- Searches CNBC HTML for article links matching pattern: `https://www.cnbc.com/YYYY/MM/...`\n- Filters out video, premium, pro, tag, section, live URLs\n- Returns up to 25 unique geopolitical article URLs\n\n### 2. Article Scraping\n- Uses Scrapling (stealth headless browser) to bypass anti-bot protections\n- Extracts: title, full article text, description metadata\n- Falls back to regex extraction if Scrapling fails\n\n### 3. Fact Extraction (NO Truncation)\n- Splits article text into complete sentences\n- Scans for 6 fact categories:\n  1. **Official**: Quoted statements with attribution (said/stated/announced)\n  2. **Action**: Military/diplomatic/economic actions (strike/launch/sanctions)\n  3. **Data**: Numbers with units (million/billion/percent/barrel/$)\n  4. **Timeline**: Dates/deadlines (by/before/after/until/expected)\n  5. **Analyst**: Forecasts/predictions (forecast/expect/project/likely/recession)\n  6. **Market**: Polymarket/prediction market language (odds/probability/betting)\n- Returns up to 5 complete facts per article\n\n### 4. Market Impact Extraction\n- Scans for energy, stocks, currency, analyst, Polymarket sentences\n- Returns complete sentences (NO length limits)\n- Categories: Energy, Stocks, Currency, Analyst, Polymarket\n\n### 5. Discord Posting\n- Formats each article as markdown\n- Checks message length against 2000-char Discord limit\n- If too long: splits into Title+URL+Market, Facts, Disclaimer parts\n- Posts each article individually (not batched)\n- Small delay (0.3s) between split parts\n\n---\n\n## File Structure\n```\nskills/cnbc-geopolitics-fetcher/\n├── SKILL.md                 # This documentation\n├── scripts/\n│   └── fetch_cnbc_geopolitics.py   # Main scraper script\n└── references/\n    └── config.md            # Discord webhook configuration\n```\n\n---\n\n## Dependencies\n- Python 3.x\n- `scrapling` (stealth web scraping)\n- `beautifulsoup4` (HTML parsing)\n- `requests` (HTTP client)\n\nInstall dependencies:\n```powershell\npip install scrapling beautifulsoup4 requests\n```\n\n---\n\n## Customization Tips\n\n### Change Article Count\n```powershell\npython fetch_cnbc_geopolitics.py --webhook \"...\" --count 10\n```\n\n### Output to File Instead of Discord\n```powershell\npython fetch_cnbc_geopolitics.py --output \"output.md\" --count 5\n```\n\n### Disable Verbose Output\nRemove `--verbose` flag for cleaner console output.\n\n---\n\n## Troubleshooting\n\n### Error: \"can't open file\"\n- Quote the full path: `python \"C:\\path\\with\\spaces\\script.py\"`\n- Use forward slashes or escape backslashes\n\n### Error: \"Discord error 400\"\n- Message exceeds 2000 characters\n- Script should auto-split, but check format_single_article() function\n\n### Error: \"No facts extracted\"\n- Article may have anti-bot protection\n- Check Scrapling installation: `pip install scrapling`\n- Try with `--verbose` to see extraction details\n\n### Error: \"ModuleNotFoundError\"\n- Install dependencies: `pip install scrapling beautifulsoup4 requests`\n\n---\n\n## LLM Integration Notes\n\n### For Any LLM to Use This Skill\n1. **Read this SKILL.md** - understand purpose and usage\n2. **Check config.md** - get webhook URL from references/config.md\n3. **Run the command** - execute the Python script with proper path quoting\n4. **Verify output** - check Discord for posted articles\n\n### Key Constraints to Remember\n- **NO truncation** - script extracts complete sentences only\n- **One-by-one posting** - each article = separate Discord message\n- **Raw facts only** - no editorial analysis or opinions\n- **Polymarket-ready** - extracts analyst forecasts and prediction market data\n\n### Example LLM Prompt\n> \"Fetch latest CNBC geopolitical news and post to Discord using the cnbc-geopolitics-fetcher skill.\"\n\n### Expected LLM Action\n1. Locate skill at: `skills/cnbc-geopolitics-fetcher/`\n2. Read config: `references/config.md` for webhook URL\n3. Execute:\n   ```powershell\n   python \"skills/cnbc-geopolitics-fetcher/scripts/fetch_cnbc_geopolitics.py\" --config \"skills/cnbc-geopolitics-fetcher/references/config.md\" --verbose\n   ```\n4. Confirm: \"5 articles posted individually to Discord\"\n\n---\n\n## Version History\n- **v2.0** (2026-03-15): One-by-one posting, NO truncation, analyst/Polymarket extraction, auto-split long messages\n- **v1.0**: Initial batched posting with truncation limits\n\n---\n\n## Support\n- Skill location: `C:\\Users\\Legion 5i Pro\\.openclaw\\workspace\\skills\\cnbc-geopolitics-fetcher\\`\n- Script: `scripts/fetch_cnbc_geopolitics.py`\n- Config: `references/config.md`\n","tags":{"latest":"1.0.3"},"stats":{"comments":0,"downloads":817,"installsAllTime":30,"installsCurrent":3,"stars":0,"versions":4},"createdAt":1773497644051,"updatedAt":1779078222560},"latestVersion":{"version":"1.0.3","createdAt":1773755924726,"changelog":"- Updated `references/sent_urls.txt` with new URLs or entries.\n- No changes to code or documentation.","license":"MIT-0"},"metadata":null,"owner":{"handle":"dimaschand29","userId":"s17a0s9khqepjjhtqr50s1z7k5884mmk","displayName":"Dimas Chandra","image":"https://avatars.githubusercontent.com/u/34400000?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780089936487}}