← back to Abrams Report
scripts/run-scrape.sh
17 lines
#!/bin/zsh
# abrams-report headline scrape (RSS + HTML). The 2 anti-bot sources (Schumacher, Wallquest) go
# through LOCAL real Chrome — $0, no Browserbase (TK-10655).
#
# Unattended = HEADLESS (ABR_BROWSER_HEADLESS=1): clean, never steals window focus on Steve's active
# workstation. Tradeoff: Wallquest's Cloudflare "managed challenge" only auto-clears for a HEADED
# Chrome, so Wallquest degrades to 0 in the cron run (its "headlines" are product-sitemap slugs — the
# least newsworthy source; Schumacher + all 30 RSS/HTML sources work headless). To capture Wallquest,
# run headed manually: cd ~/Projects/abrams-report && npm run scrape
export PATH="/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export ABR_BROWSER_HEADLESS=1
cd "$HOME/Projects/abrams-report" || exit 1
LOG="$HOME/Projects/abrams-report/data/scrape.log"
echo "[$(date '+%F %T')] scrape start" >> "$LOG"
/opt/homebrew/bin/node scrapers/scrape-all.js >> "$LOG" 2>&1
echo "[$(date '+%F %T')] scrape done (exit $?)" >> "$LOG"