#!/usr/bin/env python3
"""Sales Prospector v15 - MAXIMUM suburb expansion"""
import json, re, time, random, urllib.request, urllib.parse
from datetime import datetime
from pathlib import Path
import ssl
ssl._create_default_https_context = ssl._create_unverified_context

for d in [Path(__file__).parent / x for x in ["state", "logs", "leads"]]:
    d.mkdir(parents=True, exist_ok=True)

STATE_FILE = Path(__file__).parent / "state" / "prospector-v15-state.json"
LOG_FILE = Path(__file__).parent / "logs" / f"prospector-v15-{datetime.now().strftime('%Y%m%d')}.log"

# 50 METROS with 8-15 SUBURBS EACH - MAXIMUM COVERAGE
METROS = [
    # 1-10: Top tier
    ("New York NY", ["Manhattan", "Brooklyn", "Queens", "Bronx", "Staten Island", "Jersey City", "Newark", "Yonkers", "Stamford", "White Plains", "Greenwich", "Long Island", "Hoboken", "Bayonne", "Elizabeth"]),
    ("Los Angeles CA", ["Santa Monica", "Pasadena", "Burbank", "Glendale", "Long Beach", "Anaheim", "Irvine", "Newport Beach", "Santa Ana", "Torrance", "Beverly Hills", "West Hollywood", "Culver City", "Inglewood", "Compton"]),
    ("Chicago IL", ["Evanston", "Oak Park", "Naperville", "Schaumburg", "Skokie", "Des Plaines", "Arlington Heights", "Elmhurst", "Wheaton", "Aurora", "Joliet", "Elgin", "Barrington", "Wilmette", "Highland Park"]),
    ("Houston TX", ["Sugar Land", "The Woodlands", "Katy", "Pearland", "Baytown", "Spring", "Humble", "Kingwood", "Cypress", "Missouri City", "Pasadena", "League City", "Friendswood", "Clear Lake", "Conroe"]),
    ("Phoenix AZ", ["Scottsdale", "Tempe", "Mesa", "Chandler", "Glendale", "Peoria", "Surprise", "Goodyear", "Gilbert", "Queen Creek", "Avondale", "Buckeye", "Fountain Hills", "Paradise Valley", "Sun City"]),
    ("Philadelphia PA", ["Camden", "Chester", "Upper Darby", "Lower Merion", "Haverford", "Radnor", "Media", "West Chester", "King of Prussia", "Conshohocken", "Ambler", "Doylestown", "Newtown", "Bryn Mawr", "Ardmore"]),
    ("San Antonio TX", ["New Braunfels", "Schertz", "Cibolo", "Converse", "Universal City", "Live Oak", "Leon Valley", "Alamo Heights", "Terrell Hills", "Hollywood Park", "Stone Oak", "Boerne", "Kerrville", "Seguin", "Floresville"]),
    ("San Diego CA", ["Chula Vista", "Oceanside", "Escondido", "Carlsbad", "El Cajon", "Vista", "San Marcos", "Encinitas", "La Jolla", "Del Mar", "Solana Beach", "Rancho Santa Fe", "Poway", "Santee", "La Mesa"]),
    ("Dallas TX", ["Fort Worth", "Arlington", "Plano", "Irving", "Frisco", "McKinney", "Allen", "Richardson", "Garland", "Mesquite", "Carrollton", "Lewisville", "Flower Mound", "Southlake", "Grapevine", "Keller"]),
    ("San Jose CA", ["Sunnyvale", "Santa Clara", "Mountain View", "Palo Alto", "Cupertino", "Los Gatos", "Saratoga", "Campbell", "Milpitas", "Fremont", "Menlo Park", "Atherton", "Portola Valley", "Woodside", "East Palo Alto"]),
    
    # 11-20
    ("Austin TX", ["Round Rock", "Cedar Park", "Georgetown", "Pflugerville", "Leander", "Lakeway", "Westlake", "Bee Cave", "Dripping Springs", "Buda", "Kyle", "San Marcos", "Bastrop", "Taylor", "Elgin"]),
    ("Jacksonville FL", ["Orange Park", "St. Augustine", "Ponte Vedra", "Fleming Island", "Green Cove Springs", "Middleburg", "Nocatee", "Atlantic Beach", "Neptune Beach", "Jacksonville Beach", "Yulee", "Fernandina Beach", "Amelia Island", "Callahan", "Macclenny"]),
    ("Columbus OH", ["Dublin", "Westerville", "Gahanna", "Reynoldsburg", "Upper Arlington", "Worthington", "New Albany", "Powell", "Hilliard", "Grove City", "Delaware", "Lewis Center", "Pickerington", "Canal Winchester", "Pataskala"]),
    ("Charlotte NC", ["Matthews", "Mint Hill", "Huntersville", "Concord", "Gastonia", "Fort Mill SC", "Rock Hill SC", "Mooresville", "Cornelius", "Davidson", "Lake Norman", "Waxhaw", "Weddington", "Pineville", "Ballantyne"]),
    ("Indianapolis IN", ["Carmel", "Fishers", "Noblesville", "Greenwood", "Zionsville", "Westfield", "Avon", "Plainfield", "Brownsburg", "Greenfield", "New Palestine", "McCordsville", "Lawrence", "Beech Grove", "Speedway"]),
    ("San Francisco CA", ["Oakland", "Berkeley", "Richmond", "Walnut Creek", "San Rafael", "Sausalito", "Mill Valley", "Larkspur", "Corte Madera", "Tiburon", "Belvedere", "Alameda", "Emeryville", "Albany", "El Cerrito"]),
    ("Seattle WA", ["Bellevue", "Redmond", "Tacoma", "Kirkland", "Renton", "Everett", "Federal Way", "Kent", "Auburn", "Bothell", "Woodinville", "Issaquah", "Sammamish", "Mercer Island", "Lake Forest Park"]),
    ("Denver CO", ["Aurora", "Lakewood", "Thornton", "Westminster", "Boulder", "Littleton", "Englewood", "Centennial", "Arvada", "Parker", "Castle Rock", "Highlands Ranch", "Greenwood Village", "Cherry Hills", "Ken Caryl"]),
    ("Oklahoma City OK", ["Edmond", "Norman", "Moore", "Midwest City", "Del City", "Yukon", "Mustang", "Bethany", "Warr Acres", "The Village", "Nichols Hills", "Newcastle", "Choctaw", "Harrah", "Luther"]),
    ("Boston MA", ["Cambridge", "Somerville", "Brookline", "Newton", "Waltham", "Watertown", "Arlington", "Lexington", "Concord", "Bedford", "Burlington", "Woburn", "Reading", "Wakefield", "Melrose"]),
    
