Skip to content

Instantly share code, notes, and snippets.

@gcrbr
Created July 25, 2025 07:45
Show Gist options
  • Select an option

  • Save gcrbr/5d666b65341cd2e33f9a67e1d0e2db33 to your computer and use it in GitHub Desktop.

Select an option

Save gcrbr/5d666b65341cd2e33f9a67e1d0e2db33 to your computer and use it in GitHub Desktop.
Script che controlla posti disponibili alla spiaggia dell'Area Marina Protetta Gaiola
# Utilizzo: ./gaiola.sh DATA TURNO
# Data: formato DD/MM (es. 28/01)
# Turno: 1 (mattina), 2 (pomeriggio)
year=$(date +"%Y")
fixed_date=$(echo $1 | awk -F'/' '{print $2"-"$1}')
date="$year-$fixed_date"
turno=$2
while [ 1 ]; do
spots=$(curl -s 'https://summer.areamarinaprotettagaiola.it/booking/forms/verifica_disponibilita.php' -d "eid=904&data=$date&turno=$turno")
if [ $spots -gt 0 ]; then
echo "*** Available spot ($spots) ***\007"
open "https://www.areamarinaprotettagaiola.it/prenotazione"
break
else
echo "--- No available spots ($spots) ---"
fi
sleep 15
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment