new day logs

main
Ibraheem Saleh 8 months ago
parent aa4b0bc86b
commit ad5a8befd0

@ -392,7 +392,7 @@ curl 'https://future.ourclublogin.com/api/Scheduling/CancelAppointment' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: same-origin' \
-H 'Priority: u=0' \
--data-raw '{"ClubId":2,"LoggedInCustomerId":21873,"PrimaryCustomerId":6964,"AdditionalCustomerIds":[],"AppointmentItemId":323,"SelectedBooks":[{"Id":2,"Name":"Pickleball Court - 2","ResourceTypeId":2,"AssignedResourceId":130,"IsAssignedResourceSelectable":true}],"PackageItemId":0,"PackageQuantity":0,"ChangeFeeId":0,"StartDate":"2026-01-15T17:30:00-08:00","UserDisplayedPayNowGrandTotal":0,"DisplayedAmountDueAtTimeOfService":0,"CancellationAppointmentId":0}'
--data-raw '{"ClubId":2,"LoggedInCustomerId":21873,"PrimaryCustomerId":6964,"AdditionalCustomerIds":[],"AppointmentItemId":323,"SelectedBooks":[{"Id":2,"Name":"Pickleball Court - 2","ResourceTypeId":2,"AssignedResourceId":130,"IsAssignedResourceSelectable":true}],"PackageItemId":0,"PackageQuantity":0,"ChangeFeeId":0,"StartDate":"2026-01-19T17:30:00-08:00","UserDisplayedPayNowGrandTotal":0,"DisplayedAmountDueAtTimeOfService":0,"CancellationAppointmentId":0}'
curl 'https://future.ourclublogin.com/api/TransactionProcessing/BookAppointmentOnAccount' \
@ -416,7 +416,7 @@ curl 'https://future.ourclublogin.com/api/Scheduling/CancelAppointment' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: same-origin' \
-H 'Priority: u=0' \
--data-raw '{"ClubId":2,"LoggedInCustomerId":21873,"PrimaryCustomerId":16250,"AdditionalCustomerIds":[],"AppointmentItemId":323,"SelectedBooks":[{"Id":3,"Name":"Pickleball Court - 3","ResourceTypeId":2,"AssignedResourceId":130,"IsAssignedResourceSelectable":true}],"PackageItemId":0,"PackageQuantity":0,"ChangeFeeId":0,"StartDate":"2026-01-15T17:30:00-08:00","UserDisplayedPayNowGrandTotal":0,"DisplayedAmountDueAtTimeOfService":0,"CancellationAppointmentId":0}'
--data-raw '{"ClubId":2,"LoggedInCustomerId":21873,"PrimaryCustomerId":16250,"AdditionalCustomerIds":[],"AppointmentItemId":323,"SelectedBooks":[{"Id":3,"Name":"Pickleball Court - 3","ResourceTypeId":2,"AssignedResourceId":130,"IsAssignedResourceSelectable":true}],"PackageItemId":0,"PackageQuantity":0,"ChangeFeeId":0,"StartDate":"2026-01-19T17:30:00-08:00","UserDisplayedPayNowGrandTotal":0,"DisplayedAmountDueAtTimeOfService":0,"CancellationAppointmentId":0}'
curl 'https://future.ourclublogin.com/api/TransactionProcessing/BookAppointmentOnAccount' \
@ -440,7 +440,7 @@ curl 'https://future.ourclublogin.com/api/Scheduling/CancelAppointment' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: same-origin' \
-H 'Priority: u=0' \
--data-raw '{"ClubId":2,"LoggedInCustomerId":21873,"PrimaryCustomerId":14563,"AdditionalCustomerIds":[],"AppointmentItemId":323,"SelectedBooks":[{"Id":139,"Name":"Pickleball Court - 4","ResourceTypeId":2,"AssignedResourceId":130,"IsAssignedResourceSelectable":true}],"PackageItemId":0,"PackageQuantity":0,"ChangeFeeId":0,"StartDate":"2026-01-15T17:30:00-08:00","UserDisplayedPayNowGrandTotal":0,"DisplayedAmountDueAtTimeOfService":0,"CancellationAppointmentId":0}'
--data-raw '{"ClubId":2,"LoggedInCustomerId":21873,"PrimaryCustomerId":14563,"AdditionalCustomerIds":[],"AppointmentItemId":323,"SelectedBooks":[{"Id":139,"Name":"Pickleball Court - 4","ResourceTypeId":2,"AssignedResourceId":130,"IsAssignedResourceSelectable":true}],"PackageItemId":0,"PackageQuantity":0,"ChangeFeeId":0,"StartDate":"2026-01-19T17:30:00-08:00","UserDisplayedPayNowGrandTotal":0,"DisplayedAmountDueAtTimeOfService":0,"CancellationAppointmentId":0}'
# do this court 1 last!!!
curl 'https://future.ourclublogin.com/api/TransactionProcessing/BookAppointmentOnAccount' \
@ -464,7 +464,7 @@ curl 'https://future.ourclublogin.com/api/Scheduling/CancelAppointment' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: same-origin' \
-H 'Priority: u=0' \
--data-raw '{"ClubId":2,"LoggedInCustomerId":21873,"PrimaryCustomerId":21873,"AdditionalCustomerIds":[],"AppointmentItemId":323,"SelectedBooks":[{"Id":1,"Name":"Pickleball Court - 1","ResourceTypeId":2,"AssignedResourceId":130,"IsAssignedResourceSelectable":true}],"PackageItemId":0,"PackageQuantity":0,"ChangeFeeId":0,"StartDate":"2026-01-15T17:30:00-08:00","UserDisplayedPayNowGrandTotal":0,"DisplayedAmountDueAtTimeOfService":0,"CancellationAppointmentId":0}'
--data-raw '{"ClubId":2,"LoggedInCustomerId":21873,"PrimaryCustomerId":21873,"AdditionalCustomerIds":[],"AppointmentItemId":323,"SelectedBooks":[{"Id":1,"Name":"Pickleball Court - 1","ResourceTypeId":2,"AssignedResourceId":130,"IsAssignedResourceSelectable":true}],"PackageItemId":0,"PackageQuantity":0,"ChangeFeeId":0,"StartDate":"2026-01-19T17:30:00-08:00","UserDisplayedPayNowGrandTotal":0,"DisplayedAmountDueAtTimeOfService":0,"CancellationAppointmentId":0}'
# When it fails to book!!!!!

@ -724,9 +724,20 @@ class HarborBot:
self._print_upcoming_reservations()
last_status_print = datetime.now()
last_date = datetime.now().date()
while True:
try:
# Check for day change
current_date = datetime.now().date()
if current_date != last_date:
print(f"\n[INFO] {'='*50}")
print(f"[INFO] New day detected: {current_date.strftime('%A, %B %d, %Y')}")
print(f"[INFO] {'='*50}")
self._print_upcoming_reservations()
last_date = current_date
last_status_print = datetime.now()
self._daemon_iteration(dry_run)
# Print status every 30 minutes
@ -746,6 +757,7 @@ class HarborBot:
traceback.print_exc()
print("[INFO] Sleeping 60s before retry...")
time.sleep(60)
time.sleep(60)
def _print_upcoming_reservations(self):
"""Print status of upcoming reservations."""

@ -69,7 +69,7 @@ curl 'https://future.ourclublogin.com/api/CustomerAuth/CustomerLogin' \
* Add startup configuration validation to ensure that the AttemptSchedule is configured properly, with scheduled times incrementing as required by the algorithm.
##
* This will run on a raspberry pi on linux, implement a pure python method for sending an email everytime a court is successfully booked. Be sure to include what court was booked, what time it was booked for, and the user name and ID that the booking was creating under.
* This will run on a raspberry pi on linux, implement a pure python method for sending an email everytime a court is successfully booked. Be sure to include what court was booked, what time it was booked for, and the user name and ID that the booking was creating under. config.json will obviously need to be updated to support any number of emails that are expected to receive these success emails.
@ -82,3 +82,5 @@ python harbor_bot.py --test-book Court_1 Saleh 2026-01-19 "19:00:00-08:00"
python harbor_bot.py --test-book Court_1 Saleh 2026-01-19 "19:00:00-08:00" --live
python harbor_bot.py --daemon --live
# python harbor_bot.py --test-email (See smtp-email-notifications-attempt branch, gmail smtp doesn't actually work)
python harbor_bot.py --show-config
Loading…
Cancel
Save