| import requests |
| import json |
| import time |
| import random |
| from duckduckgo_search import DDGS |
| import trafilatura |
|
|
| |
| CLOUD_URL = "https://paritosh-sovereign-friday-subconscious.hf.space/system/external-ingest" |
| SOVEREIGN_PIN = "1978" |
|
|
| STRATEGIC_TOPICS = [ |
| "Regional Demographics and Residential Trends India 2024", |
| "Strategic Infrastructure development and upcoming projects by Area", |
| "Autonomous CRM Automation and OttoPilot strategies", |
| "Deep Learning for Agentic Workflow Orchestration", |
| "Strategic Finance & Venture Capital Risk Management" |
| ] |
|
|
| def scrape_url(url): |
| """Local scraper logic using trafilatura.""" |
| try: |
| downloaded = trafilatura.fetch_url(url) |
| content = trafilatura.extract(downloaded) |
| return content[:3000] if content else None |
| except: |
| return None |
|
|
| def hunt(): |
| print("π [LOCAL HUNTER] Starting Sovereign Foraging Protocol...") |
| print(f"π TARGET: {CLOUD_URL}") |
| print("β" * 50) |
|
|
| for topic in STRATEGIC_TOPICS: |
| print(f"\nπ Hunting Intelligence: {topic}") |
| results = [] |
| |
| try: |
| with DDGS(timeout=30) as ddgs: |
| ddg_results = list(ddgs.text(topic, max_results=3)) |
| |
| for r in ddg_results: |
| print(f" β³ Capturing Source: {r['href']}") |
| body = scrape_url(r['href']) |
| if body: |
| results.append({ |
| "title": r['title'], |
| "url": r['href'], |
| "body": body |
| }) |
| time.sleep(random.uniform(2, 5)) |
| |
| |
| if results: |
| payload = { |
| "topic": topic, |
| "results": results, |
| "secret": SOVEREIGN_PIN |
| } |
| resp = requests.post(CLOUD_URL, json=payload) |
| if resp.status_code == 200: |
| print(f"β
SUCCESS: {len(results)} intelligence packages beamed to Cloud.") |
| else: |
| print(f"β οΈ CLOUD REJECTION: {resp.status_code} - {resp.text}") |
| |
| except Exception as e: |
| print(f"β HUNT ERROR for {topic}: {e}") |
| |
| time.sleep(random.randint(10, 20)) |
|
|
| print("\nβ" * 50) |
| print("π [LOCAL HUNTER] Mission Complete. Grid Rejuvenated.") |
|
|
| if __name__ == "__main__": |
| hunt() |
|
|