#!/usr/bin/env python3
# Load .env file
import pathlib
_env_path = pathlib.Path.home() / ".openclaw/workspace/.env"
if _env_path.exists():
    for _line in _env_path.read_text().splitlines():
        if _line.strip() and not _line.startswith("#") and "=" in _line:
            _k, _v = _line.split("=", 1)
            import os as _os; _os.environ.setdefault(_k.strip(), _v.strip())
"""
Pinterest Automation - Configuration
"""

import os
from pathlib import Path

# Paths
WORKSPACE = Path(os.path.expanduser("~/.openclaw/workspace"))
ETSY_DESIGNS = Path(os.path.expanduser("~/Documents/Etsy Designs"))
ARCHIVE_DIR = ETSY_DESIGNS / "04-Archive"
DATA_DIR = WORKSPACE / "data"
LISTINGS_JSON = DATA_DIR / "etsy-listing-urls.json"

# Publer API (stored in .env file)
PUBLER_API_KEY = os.getenv("PUBLER_API_KEY", "")
PUBLER_API_BASE = "https://app.publer.com/api/v1"
PUBLER_WORKSPACE_ID = os.getenv("PUBLER_WORKSPACE_ID", "")

# Social Media Accounts (Publer IDs - stored in .env file)
PINTEREST_ACCOUNT_ID = os.getenv("PINTEREST_ACCOUNT_ID", "")
FACEBOOK_ACCOUNT_ID = os.getenv("FACEBOOK_ACCOUNT_ID", "6995531d19e8a8e4e29291df")
INSTAGRAM_ACCOUNT_ID = os.getenv("INSTAGRAM_ACCOUNT_ID", "6995538119e8a8e4e29292aa")

# Etsy Shop
ETSY_SHOP_NAME = "RoyalStylesCreations"
ETSY_SHOP_URL = "https://www.etsy.com/shop/RoyalStylesCreations"

# Pinterest Board Mappings (category -> board ID)
PINTEREST_BOARD_IDS = {
    "Military": "1082552897870101585",          # USMC & Marine Corps SVGs
    "Patriotic": "1082552897870101587",          # Patriotic & American Designs
    "Reformed SVGs": "1082552897870101588",      # Reformed Christian Art
    "Nature/Animals/Insects": "1082552897870101593",  # Nature & Outdoor SVGs
    "Easter SVGs": "1082552897870101588"         # Reformed Christian Art
}

# Pinterest Board Names (for logging)
PINTEREST_BOARDS = {
    "Military": "USMC & Marine Corps SVGs",
    "Patriotic": "Patriotic & American Designs",
    "Reformed SVGs": "Reformed Christian Art",
    "Nature/Animals/Insects": "Nature & Outdoor SVGs",
    "Easter SVGs": "Reformed Christian Art"
}

# Niche mappings for description generation
CATEGORY_TO_NICHE = {
    "Military": "military",
    "Patriotic": "patriotic",
    "Reformed SVGs": "christian",
    "Nature/Animals/Insects": "outdoor",
    "Easter SVGs": "christian"
}

# Files to exclude from posting
EXCLUDED_FILES = ["whats-included.jpg", "whats-included.png"]

# Logging
LOG_DIR = WORKSPACE / "logs"
LOG_DIR.mkdir(exist_ok=True)
