Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -1076,49 +1076,49 @@ def fetch_google_hotels(query="Birmingham Hotel", check_in="2024-08-14", check_o
|
|
1076 |
|
1077 |
hotel_info = ""
|
1078 |
for hotel in hotel_results[:5]: # Limiting to top 5 hotels
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
return hotel_info
|
1122 |
|
1123 |
|
1124 |
|
|
|
1076 |
|
1077 |
hotel_info = ""
|
1078 |
for hotel in hotel_results[:5]: # Limiting to top 5 hotels
|
1079 |
+
name = hotel.get('name', 'No name')
|
1080 |
+
description = hotel.get('description', 'No description')
|
1081 |
+
link = hotel.get('link', '#')
|
1082 |
+
check_in_time = hotel.get('check_in_time', 'N/A')
|
1083 |
+
check_out_time = hotel.get('check_out_time', 'N/A')
|
1084 |
+
rate_per_night = hotel.get('rate_per_night', {}).get('lowest', 'N/A')
|
1085 |
+
before_taxes_fees = hotel.get('rate_per_night', {}).get('before_taxes_fees', 'N/A')
|
1086 |
+
total_rate = hotel.get('total_rate', {}).get('lowest', 'N/A')
|
1087 |
+
deal = hotel.get('deal', 'N/A')
|
1088 |
+
deal_description = hotel.get('deal_description', 'N/A')
|
1089 |
+
nearby_places = hotel.get('nearby_places', [])
|
1090 |
+
amenities = hotel.get('amenities', [])
|
1091 |
+
|
1092 |
+
# Adding the "Location" field
|
1093 |
+
location = f"{name}, Birmingham, AL"
|
1094 |
+
|
1095 |
+
hotel_info += f"**Hotel Name:** [{name}]({link})\n"
|
1096 |
+
hotel_info += f"**Location:** {location}\n"
|
1097 |
+
hotel_info += f"**Description:** {description}\n"
|
1098 |
+
hotel_info += f"**Check-in Time:** {check_in_time}\n"
|
1099 |
+
hotel_info += f"**Check-out Time:** {check_out_time}\n"
|
1100 |
+
hotel_info += f"**Rate per Night:** {rate_per_night} (Before taxes/fees: {before_taxes_fees})\n"
|
1101 |
+
hotel_info += f"**Total Rate:** {total_rate}\n"
|
1102 |
+
hotel_info += f"**Deal:** {deal} ({deal_description})\n"
|
1103 |
+
|
1104 |
+
if nearby_places:
|
1105 |
+
hotel_info += "**Nearby Places:**\n"
|
1106 |
+
for place in nearby_places:
|
1107 |
+
place_name = place.get('name', 'Unknown Place')
|
1108 |
+
transportations = place.get('transportations', [])
|
1109 |
+
hotel_info += f" - {place_name}:\n"
|
1110 |
+
for transport in transportations:
|
1111 |
+
transport_type = transport.get('type', 'N/A')
|
1112 |
+
duration = transport.get('duration', 'N/A')
|
1113 |
+
hotel_info += f" - {transport_type}: {duration}\n"
|
1114 |
+
|
1115 |
+
if amenities:
|
1116 |
+
hotel_info += "**Amenities:**\n"
|
1117 |
+
hotel_info += ", ".join(amenities) + "\n"
|
1118 |
+
|
1119 |
+
hotel_info += "-" * 50 + "\n"
|
1120 |
+
|
1121 |
+
return hotel_info
|
1122 |
|
1123 |
|
1124 |
|