Created
July 25, 2025 07:45
-
-
Save gcrbr/5d666b65341cd2e33f9a67e1d0e2db33 to your computer and use it in GitHub Desktop.
Script che controlla posti disponibili alla spiaggia dell'Area Marina Protetta Gaiola
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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