From ad5a8befd099e2163d3792e701f3fe99e136b9fd Mon Sep 17 00:00:00 2001 From: Ibraheem Saleh Date: Sun, 11 Jan 2026 21:34:26 -0800 Subject: [PATCH] new day logs --- HarborIslesAPIs.txt | 8 ++++---- harbor_bot.py | 12 ++++++++++++ prompts.txt | 6 ++++-- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/HarborIslesAPIs.txt b/HarborIslesAPIs.txt index 7ba8a28..7ae9b27 100644 --- a/HarborIslesAPIs.txt +++ b/HarborIslesAPIs.txt @@ -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!!!!! diff --git a/harbor_bot.py b/harbor_bot.py index 142a704..acd9fe4 100644 --- a/harbor_bot.py +++ b/harbor_bot.py @@ -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.""" diff --git a/prompts.txt b/prompts.txt index 6ce376f..5dcc38e 100644 --- a/prompts.txt +++ b/prompts.txt @@ -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. @@ -81,4 +81,6 @@ curl 'https://future.ourclublogin.com/api/CustomerAuth/CustomerLogin' \ 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 \ No newline at end of file +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 \ No newline at end of file