#!/bin/bash
# Scrape NZ packhouses & cool storage from Google Maps

ACTOR_ID="compass/crawler-google-places"

# Region 1: Hawke's Bay (biggest apple region)
echo "=== Scraping Hawke's Bay ==="
apify call $ACTOR_ID --input '{
  "searchStringsArray": [
    "packhouse Hastings New Zealand",
    "cool storage Hastings New Zealand",
    "cold storage Napier New Zealand",
    "packhouse Hawke'\''s Bay New Zealand"
  ],
  "maxCrawledPlacesPerSearch": 50,
  "language": "en",
  "exportPlaceUrls": false,
  "includeWebResults": false
}' --output-dataset hawkes-bay-facilities

# Region 2: Bay of Plenty (kiwifruit)
echo "=== Scraping Bay of Plenty ==="
apify call $ACTOR_ID --input '{
  "searchStringsArray": [
    "packhouse Tauranga New Zealand",
    "cool storage Tauranga New Zealand",
    "packhouse Te Puke New Zealand",
    "kiwifruit packhouse Bay of Plenty"
  ],
  "maxCrawledPlacesPerSearch": 50,
  "language": "en"
}' --output-dataset bay-of-plenty-facilities

# Region 3: Nelson/Tasman (apples)
echo "=== Scraping Nelson ==="
apify call $ACTOR_ID --input '{
  "searchStringsArray": [
    "packhouse Nelson New Zealand",
    "cool storage Motueka New Zealand",
    "apple packhouse Nelson",
    "cold storage Nelson Tasman"
  ],
  "maxCrawledPlacesPerSearch": 50,
  "language": "en"
}' --output-dataset nelson-facilities

# Region 4: Gisborne (citrus)
echo "=== Scraping Gisborne ==="
apify call $ACTOR_ID --input '{
  "searchStringsArray": [
    "packhouse Gisborne New Zealand",
    "cool storage Gisborne",
    "citrus packhouse Gisborne"
  ],
  "maxCrawledPlacesPerSearch": 50,
  "language": "en"
}' --output-dataset gisborne-facilities

# Region 5: Central Otago (stonefruit/cherries)
echo "=== Scraping Central Otago ==="
apify call $ACTOR_ID --input '{
  "searchStringsArray": [
    "packhouse Central Otago New Zealand",
    "cool storage Cromwell New Zealand",
    "packhouse Alexandra New Zealand"
  ],
  "maxCrawledPlacesPerSearch": 50,
  "language": "en"
}' --output-dataset otago-facilities

echo "=== Scraping complete! ==="
