← back to Commercialrealestate

scripts/sweep-remaining-metros.sh

20 lines

#!/bin/bash
# Complete the multi-metro sweep the CORRECT way: one fresh Browserbase session per
# metro (each short enough to beat the session-lifetime limit that killed the single
# all-metros run at malibu). Sequential to avoid parallel writes to listings.json.
export NODE_PATH="$HOME/.claude/skills/browserbase/node_modules"
cd "$HOME/Projects/commercialrealestate" || exit 1
REMAINING="newport-beach montecito san-francisco silicon-valley atherton hillsborough woodside miami miami-beach palm-beach naples nyc greenwich hamptons las-vegas texas aspen vail telluride"
for m in $REMAINING; do
  echo "=== sweeping $m ==="
  node scripts/refresh-listings-multi.js "$m" 2>&1 | grep -E "captured|ADDED|FATAL|session now holds" | sed "s/^/  [$m] /"
done
echo "=== ALL REMAINING METROS DONE ==="
python3 -c "
import json; d=json.load(open('data/listings.json'))
from collections import Counter
c=Counter(l.get('metro') for l in d['listings'] if l.get('metro'))
print('total listings:', len(d['listings']))
for m,n in c.most_common(): print(f'  {m}: {n}')
"