← back to Dw Yolo Loop

scripts/dark-vendor-check/dark-vendor-check.sh

16 lines

#!/bin/sh
# dark-vendor-check (c43) — READ-ONLY. c42 found 4 vendors with ALL collections
# empty live. This distinguishes mis-collected (PDPs live, just not in a collection)
# from CATALOG-DARK (PDPs 404 + all archived/draft). VERDICT: all 4 are fully DARK
# (collections empty + sample PDPs 404 live + mirror 100% archived/draft) = 1,943
# products not shopper-reachable. Not a collection-assignment fix; a reactivation
# (gated, needs cost-enrichment per c36) or intentional-hide decision. $0.
PSQL=/opt/homebrew/opt/postgresql@14/bin/psql
DB="postgresql:///dw_unified?host=/tmp"
for v in "Colefax and Fowler" "Carlisle & Co. Walls" "1838 Wallcoverings" "Paul Montgomery"; do
  echo "## $v"
  $PSQL "$DB" -c "select status, count(*) from shopify_products where vendor='$v' group by status order by 2 desc;"
  h=$($PSQL "$DB" -t -A -c "select handle from shopify_products where vendor='$v' and handle<>'' order by random() limit 1;")
  echo "  live PDP $h -> HTTP $(curl -s -o /dev/null -w '%{http_code}' --max-time 12 https://www.designerwallcoverings.com/products/$h.json)"
done