Spaces:
Sleeping
Sleeping
Upload main.py
Browse files309 unmodified lines310311312313314315316313317318319320424 unmodified lines745746747744745748747748749750751752753309 unmodified lines # Add lastUpdated if it exists in the sheet if last_updated and str(last_updated).strip(): # Only add if it's in the format yyyy-MM-dd HH:mm:ss last_updated_str = str(last_updated).strip() # Check if it matches the expected date format if re.match(r'^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$', last_updated_str): processed_item['lastUpdated'] = str(last_updated).strip() processed_item['lastUpdated'] = last_updated_str processed_data.append(processed_item) return processed_data424 unmodified lines category_changes_for_api.append(change_info) change_detected_for_webhook = True change_info_webhook = change_info # Store last change for potential webhook # Add lastUpdated field to new_item when changes detected new_item['lastUpdated'] = timestamp_iso else: # This is a new item, add lastUpdated field new_item['lastUpdated'] = timestamp_iso # This is a new item, but don't add lastUpdated field here pass
# Prepare webhook only if a change was found AND cache was ready if change_detected_for_webhook and cache["is_ready"] and VALUE_WEBHOOK_URL:main.py+7-5