Pijush2023 commited on
Commit
d1fe1c9
·
verified ·
1 Parent(s): 0c4943d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -970,7 +970,7 @@ def fetch_yelp_restaurants():
970
 
971
 
972
 
973
- def fetch_google_hotels(query="Birmingham hotels", check_in="2024-08-14", check_out="2024-08-15", adults=2):
974
  params = {
975
  "engine": "google_hotels",
976
  "q": query,
@@ -985,12 +985,10 @@ def fetch_google_hotels(query="Birmingham hotels", check_in="2024-08-14", check_
985
 
986
  search = GoogleSearch(params)
987
  results = search.get_dict()
988
- hotel_results = results.get("hotel_results", [])
989
-
990
 
991
  hotel_info = ""
992
-
993
- for hotel in hotel_data:
994
  name = hotel.get('name', 'No name')
995
  description = hotel.get('description', 'No description')
996
  link = hotel.get('link', '#')
 
970
 
971
 
972
 
973
+ def fetch_google_hotels(query="Birmingham Hotel", check_in="2024-08-14", check_out="2024-08-15", adults=2):
974
  params = {
975
  "engine": "google_hotels",
976
  "q": query,
 
985
 
986
  search = GoogleSearch(params)
987
  results = search.get_dict()
988
+ hotel_results = results.get("properties", [])
 
989
 
990
  hotel_info = ""
991
+ for hotel in hotel_results[:5]: # Limiting to top 5 hotels
 
992
  name = hotel.get('name', 'No name')
993
  description = hotel.get('description', 'No description')
994
  link = hotel.get('link', '#')