57 lines
1.8 KiB
Bash
57 lines
1.8 KiB
Bash
|
|
#!/bin/bash
|
||
|
|
# GMB Scraper v4 Wrapper — Pain-Aware Lead Generation
|
||
|
|
# ====================================================
|
||
|
|
#
|
||
|
|
# Usage:
|
||
|
|
# ./scrape.sh "lawyers Perth CBD" # Basic scrape
|
||
|
|
# ./scrape.sh "dentists Joondalup" --detect-pain # Pain detection
|
||
|
|
# ./scrape.sh "accountants Perth" --full # Full analysis
|
||
|
|
# ./scrape.sh "lawyers Perth" --full --channel email # Email pitches
|
||
|
|
# ./scrape.sh "dentists Perth" --detect-pain --min-pain 25 # High pain only
|
||
|
|
#
|
||
|
|
# Presets:
|
||
|
|
# --full = --detect-pain --scrape-reviews --check-websites --pitch-report
|
||
|
|
# --quick = --detect-pain (no reviews, no website checks)
|
||
|
|
# --leads = --detect-pain --check-websites --pitch-report
|
||
|
|
|
||
|
|
QUERY="${1:?Usage: ./scrape.sh \"query\" [options]}"
|
||
|
|
shift
|
||
|
|
|
||
|
|
# Check for presets
|
||
|
|
FULL_MODE=false
|
||
|
|
QUICK_MODE=false
|
||
|
|
LEADS_MODE=false
|
||
|
|
EXTRA_ARGS=""
|
||
|
|
|
||
|
|
for arg in "$@"; do
|
||
|
|
case "$arg" in
|
||
|
|
--full)
|
||
|
|
FULL_MODE=true
|
||
|
|
;;
|
||
|
|
--quick)
|
||
|
|
QUICK_MODE=true
|
||
|
|
;;
|
||
|
|
--leads)
|
||
|
|
LEADS_MODE=true
|
||
|
|
;;
|
||
|
|
*)
|
||
|
|
EXTRA_ARGS="$EXTRA_ARGS $arg"
|
||
|
|
;;
|
||
|
|
esac
|
||
|
|
done
|
||
|
|
|
||
|
|
# Apply presets
|
||
|
|
if [ "$FULL_MODE" = true ]; then
|
||
|
|
EXTRA_ARGS="--detect-pain --scrape-reviews --check-websites --pitch-report --json $EXTRA_ARGS"
|
||
|
|
elif [ "$QUICK_MODE" = true ]; then
|
||
|
|
EXTRA_ARGS="--detect-pain --json $EXTRA_ARGS"
|
||
|
|
elif [ "$LEADS_MODE" = true ]; then
|
||
|
|
EXTRA_ARGS="--detect-pain --check-websites --pitch-report --json $EXTRA_ARGS"
|
||
|
|
fi
|
||
|
|
|
||
|
|
# Activate venv and run
|
||
|
|
source /root/tools/gmb-scraper/venv/bin/activate 2>/dev/null || true
|
||
|
|
PYTHONPATH=/root/tools/gmb-scraper /root/tools/gmb-scraper/venv/bin/python /root/tools/gmb-scraper/gmb_scraper.py \
|
||
|
|
-q "$QUERY" \
|
||
|
|
$EXTRA_ARGS
|