Friday-Subconscious / scripts /local_hunter.py
Paritosh Upadhyay
Local Hunter Protocol: External Ingest Portal & Mac Scout Script
9ea4e09
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()