import requests import json import time import random from duckduckgo_search import DDGS import trafilatura # --- CONFIGURATION --- 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)) # Human-like jitter # PUSH TO CLOUD 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)) # Cool down between topics print("\n═" * 50) print("šŸ [LOCAL HUNTER] Mission Complete. Grid Rejuvenated.") if __name__ == "__main__": hunt()