#!/bin/bash
# Batch partner-shop search for all 14 retro games
VENV=/home/hermes/venv/bin/python3
SCRIPT=/home/hermes/workspace/partner_shop_search.py
OUT=/tmp/retro_links
mkdir -p "$OUT"

# Format: game_name|article_filename
GAMES=(
  "Gloomhaven|artikel_gloomhaven_retro_2026-06-15.html"
  "Spirit Island|artikel_spirit_island_retro_2026-06-15.html"
  "Wingspan|artikel_wingspan_retro_2026-06-15.html"
  "Root|artikel_root_retro_2026-06-15.html"
  "Nemesis|artikel_nemesis_retro_2026-06-15.html"
  "7th Continent|artikel_7th_continent_retro_2026-06-15.html"
  "Tainted Grail|artikel_tainted_grail_retro_2026-06-15.html"
  "Sleeping Gods|artikel_sleeping_gods_retro_2026-06-15.html"
  "Oathsworn|artikel_oathsworn_retro_2026-06-15.html"
  "Blood on the Clocktower|artikel_blood_on_the_clocktower_retro_2026-06-15.html"
  "Earthborne Rangers|artikel_earthborne_rangers_retro_2026-06-15.html"
  "Captain Sonar|artikel_captain_sonar_retro_2016_2026-06-12.html"
  "Vast: The Crystal Caverns|artikel_vast_crystal_caverns_retro_2016_2026-06-12.html"
  "The Colonists|artikel_the_colonists_retro_2016_2026-06-12.html"
)

for entry in "${GAMES[@]}"; do
  game="${entry%%|*}"
  article="${entry##*|}"
  safe_name=$(echo "$game" | sed 's/ /_/g; s/:/-/g')
  echo "=== $game ==="
  $VENV $SCRIPT "$game" 2>/dev/null > "$OUT/${safe_name}.html"
  echo "  -> $OUT/${safe_name}.html ($(wc -c < "$OUT/${safe_name}.html") bytes)"
done

echo ""
echo "DONE. All 14 snippets in $OUT/"
ls -la "$OUT"/
