- Stealth mode: playwright-stealth, random fingerprints, human delays - Retry logic: exponential backoff (3 attempts) - Logging: rotating logs to /root/.hermes/logs/gmb/ - Validation: phone/website/rating validation + dedup - Pain detection: 12 signals, scoring, service matching - Review scraper: extract reviews + pain keyword detection - Website health: SSL, speed, mobile, contact form checks - Pitch generator: Apex pitches (SMS, email, call, Gumtree) - Docker containerization - .env for secrets (no hardcoded API keys) - Integration with Pipecat voice dialer (gmb_to_voice.py)
56 lines
1.8 KiB
Bash
Executable file
56 lines
1.8 KiB
Bash
Executable file
#!/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
|