chore: refresh opening hours from Google every 24 hours
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -17,14 +17,14 @@ services:
|
||||
|
||||
orari:
|
||||
# Legge gli orari dalla scheda Google Business Profile (Places API) ogni
|
||||
# 6 ore e li scrive in orari.json (ADR 0005). La chiave sta solo nel .env
|
||||
# 24 ore e li scrive in orari.json (ADR 0005). La chiave sta solo nel .env
|
||||
# del server, copiato da deploy.sh a partire da .env.server locale.
|
||||
image: node:22-alpine
|
||||
container_name: officinezuliani-orari
|
||||
restart: always
|
||||
env_file:
|
||||
- .env
|
||||
command: ["node", "/app/orari-google.mjs", "--out", "/dati/orari.json", "--ogni", "6"]
|
||||
command: ["node", "/app/orari-google.mjs", "--out", "/dati/orari.json", "--ogni", "24"]
|
||||
volumes:
|
||||
- ./scripts:/app:ro
|
||||
- orari-dati:/dati
|
||||
|
||||
@@ -17,3 +17,6 @@ Opening hours were hard-coded in the site. The client keeps them up to date on t
|
||||
- The client edits hours only on Google; the sign follows within 6 hours, without a deploy. The /dove-siamo table and JSON-LD update at the next deploy.
|
||||
- About 120 Place Details requests per month: expected to stay within Google Maps Platform free monthly usage, but a billing account is required — check the current price list.
|
||||
- If Google returns no regular hours, nothing is overwritten (no blank sign).
|
||||
|
||||
## Update (2026-11-04)
|
||||
Refresh interval changed from 6 to **24 hours** (owner's request: hours change rarely). The sign therefore follows a change on Google within a day; about 30 requests per month plus one per deploy.
|
||||
|
||||
@@ -13,7 +13,7 @@ Requirements: SSH key access as `root@217.76.62.220`, Docker with buildx, Node/n
|
||||
## Opening hours from Google (ADR 0005)
|
||||
- Find the Place ID once: `set -a; source .env.server; set +a; node scripts/orari-google.mjs --cerca "Officine Zuliani Udine"`
|
||||
- Each deploy refreshes `src/data/orari-google.json` (commit it with the deploy)
|
||||
- On the server, container `officinezuliani-orari` refreshes `/dati/orari.json` every 6 hours: `docker compose logs orari` shows the last updates
|
||||
- On the server, container `officinezuliani-orari` refreshes `/dati/orari.json` every 24 hours: `docker compose logs orari` shows the last updates
|
||||
|
||||
## Publish a hostname (one-time, Nginx Proxy Manager UI)
|
||||
1. DNS: A record of the hostname → `217.76.62.220`
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// Uso:
|
||||
// node scripts/orari-google.mjs --cerca "Officine Zuliani Udine" → trova il Place ID
|
||||
// node scripts/orari-google.mjs --out src/data/orari-google.json → aggiorna una volta
|
||||
// node scripts/orari-google.mjs --out /dati/orari.json --ogni 6 → ripete ogni 6 ore (server)
|
||||
// node scripts/orari-google.mjs --out /dati/orari.json --ogni 24 → ripete ogni 24 ore (server)
|
||||
//
|
||||
// Variabili d'ambiente: GOOGLE_PLACES_API_KEY, GOOGLE_PLACE_ID.
|
||||
// Se Google non risponde o i dati non sono validi, il file esistente NON viene toccato.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"fonte": "google",
|
||||
"aggiornato": "2026-11-04T15:14:44.384Z",
|
||||
"aggiornato": "2026-11-04T15:22:48.382Z",
|
||||
"statoAttivita": "OPERATIONAL",
|
||||
"settimana": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user