#!/bin/bash # Generate massive number of city pages using template file TEMPLATE="/tmp/page-template.html" # Extended cities SWEDEN_CITIES="stockholm|Stockholm goteborg|Göteborg malmo|Malmö uppsala|Uppsala linkoping|Linköping orebro|Örebro vasteras|Västerås helsingborg|Helsingborg jonkoping|Jönköping" GERMANY_CITIES="berlin|Berlin hamburg|Hamburg munich|München cologne|Köln frankfurt|Frankfurt stuttgart|Stuttgart dusseldorf|Düsseldorf dortmund|Dortmund essen|Essen" FRANCE_CITIES="paris|Paris marseille|Marseille lyon|Lyon toulouse|Toulouse nice|Nice nantes|Nantes strasbourg|Strasbourg montpellier|Montpellier bordeaux|Bordeaux" UK_CITIES="london|London manchester|Manchester birmingham|Birmingham glasgow|Glasgow liverpool|Liverpool leeds|Leeds sheffield|Sheffield edinburgh|Edinburgh bristol|Bristol" NETHERLANDS_CITIES="amsterdam|Amsterdam rotterdam|Rotterdam the-hague|Den_Haag utrecht|Utrecht eindhoven|Eindhoven tilburg|Tilburg groningen|Groningen almere|Almere breda|Breda" DENMARK_CITIES="copenhagen|Copenhagen aarhus|Aarhus odense|Odense aalborg|Aalborg esbjerg|Esbjerg" NORWAY_CITIES="oslo|Oslo bergen|Bergen trondheim|Trondheim stavanger|Stavanger bodo|Bodø" FINLAND_CITIES="helsinki|Helsinki espoo|Espoo tampere|Tampere vantaa|Vantaa oulu|Oulu" # 20 services SERVICES=( "bridge-inspection|Bridge Inspection|Professional bridge inspection services in CITY_NAME. COMPLIANCE compliant." "facade-inspection|Facade Inspection|Building facade inspection and documentation in CITY_NAME. Identify maintenance needs." "road-condition|Road Condition Assessment|AI-assisted road surface analysis and condition mapping across CITY_NAME. Potholes, cracks, markings." "street-lighting|Street Lighting Inspection|Verify street light functionality and coverage across CITY_NAME. Night-time verification missions." "construction-monitoring|Construction Monitoring|Document construction progress and verify compliance in CITY_NAME. Timestamped evidence." "property-verification|Property Verification|Verify property condition, occupancy, and maintenance status in CITY_NAME. For insurers and landlords." "retail-audit|Retail Audit|Document storefront conditions, signage compliance, and competitor presence in CITY_NAME." "accessibility-audit|Accessibility Audit|Verify accessibility compliance for public spaces and businesses in CITY_NAME." "environmental-monitoring|Environmental Monitoring|Track environmental conditions, pollution, and green space status in CITY_NAME." "storm-damage|Storm Damage Documentation|Rapid post-storm documentation of damage across CITY_NAME. Insurance claims and emergency response." "parking-inspection|Parking Inspection|Inspect parking facilities, signage, and accessibility compliance in CITY_NAME." "traffic-sign|Traffic Sign Inspection|Verify traffic sign condition, placement, and visibility across CITY_NAME." "solar-panel|Solar Panel Inspection|Document solar panel installations and assess condition in CITY_NAME. For energy companies." "roof-inspection|Roof Inspection|Aerial and ground-based roof condition assessment in CITY_NAME. Identify damage and maintenance needs." "graffiti-monitoring|Graffiti Monitoring|Track graffiti incidents and removal status across CITY_NAME. For municipalities and property managers." "waste-management|Waste Management Audit|Verify waste container placement, overflow, and collection status in CITY_NAME." "sidewalk-condition|Sidewalk Condition|Document sidewalk defects, obstacles, and accessibility issues in CITY_NAME." "tree-inventory|Tree Inventory|Document tree locations, species, and health status in CITY_NAME. For urban forestry." "flood-damage|Flood Damage Assessment|Rapid documentation of flood damage and water levels in CITY_NAME. Insurance and emergency response." "wildlife-monitoring|Wildlife Monitoring|Track wildlife presence, habitats, and human-wildlife conflicts in and around CITY_NAME." ) get_flag() { case "$1" in sweden) echo "🇸🇪" ;; germany) echo "🇩🇪" ;; france) echo "🇫🇷" ;; uk) echo "🇬🇧" ;; netherlands) echo "🇳🇱" ;; denmark) echo "🇩🇰" ;; norway) echo "🇳🇴" ;; finland) echo "🇫🇮" ;; esac } get_compliance() { case "$1" in sweden) echo "Trafikverket" ;; germany) echo "DIN" ;; france) echo "CEREMA" ;; uk) echo "DfT" ;; netherlands) echo "Rijkswaterstaat" ;; denmark) echo "Vejdirektoratet" ;; norway) echo "Statens vegvesen" ;; finland) echo "Väylävirasto" ;; esac } # Generate related services (pick 5 random) generate_related() { local current_svc="$1" local city_slug="$2" local city_name="$3" local result="" local count=0 for svc in "${SERVICES[@]}"; do local s_slug=$(echo "$svc" | cut -d'|' -f1) local s_name=$(echo "$svc" | cut -d'|' -f2) if [[ "$s_slug" != "$current_svc" && $count -lt 5 ]]; then result+="

$s_name

Available in $city_name →

" ((count++)) fi done echo "$result" } count=0 for country in sweden germany france uk netherlands denmark norway finland; do flag=$(get_flag "$country") compliance=$(get_compliance "$country") cities_var="${country^^}_CITIES" cities="${!cities_var}" [[ -z "$cities" ]] && continue for city_info in $cities; do city_slug=$(echo "$city_info" | cut -d'|' -f1) city_name=$(echo "$city_info" | cut -d'|' -f2 | tr '_' ' ') country_title=$(echo "$country" | awk '{print toupper(substr($0,1,1)) substr($0,2)}') for service in "${SERVICES[@]}"; do svc_slug=$(echo "$service" | cut -d'|' -f1) svc_name=$(echo "$service" | cut -d'|' -f2) svc_desc=$(echo "$service" | cut -d'|' -f3) # Replace placeholders desc=$(echo "$svc_desc" | sed "s/CITY_NAME/$city_name/g; s/COMPLIANCE/$compliance/g") related=$(generate_related "$svc_slug" "$city_slug" "$city_name") sed -e "s|SERVICE_NAME|$svc_name|g" \ -e "s|SERVICE_SLUG|$svc_slug|g" \ -e "s|CITY_NAME|$city_name|g" \ -e "s|CITY_SLUG|$city_slug|g" \ -e "s|COUNTRY|$country|g" \ -e "s|COUNTRY_TITLE|$country_title|g" \ -e "s|FLAG|$flag|g" \ -e "s|COMPLIANCE|$compliance|g" \ -e "s|SERVICE_DESC|$desc|g" \ -e "s|RELATED_SERVICES|$related|g" \ "$TEMPLATE" | aws s3 cp - "s3://quixzoom-landing-prod/$svc_slug/$city_slug.html" --content-type "text/html" --cache-control "max-age=3600" ((count++)) # Progress every 50 pages if ((count % 50 == 0)); then echo "Progress: $count pages generated" fi done done done echo "" echo "✅ Generated $count city-specific landing pages" aws cloudfront create-invalidation --distribution-id EE30B9WM5ZYM7 --paths "/*" --query 'Invalidation.Id' --output text