@@ -14,20 +14,21 @@ class PlacesUtils
1414 "AIzaSyBY_oLHUmf8-C9b7hkRtYC34ThjuNyliDw" ,
1515 "AIzaSyB6aCRNMXBNIlT4dUXI_c47Dgd8UeZ3mDQ" ,
1616 "AIzaSyCEbuWklDLV0973ygPglKadB6sGnY4gFC4" ,
17- "AIzaSyD8i-bcDlTzDJXaj-mNo1l7CCvts845_w8"
17+ "AIzaSyD8i-bcDlTzDJXaj-mNo1l7CCvts845_w8" ,
18+ "AIzaSyCiowQGzYIH10U5WRDb4aaM8_qLhYdT4Q8"
1819 ]
19- API_KEY = api_keys . sample
20+ API_KEY = api_keys . last
2021
2122 def self . get_places ( places_count , lat , lon , date , type , place_properties , keyword = "" , radius = 1000 )
2223 if type === "restaurant"
2324 request = RestClient ::Request . execute (
2425 method : :get ,
25- url : "#{ ENDPOINT } /nearbysearch/json?location=#{ lat } ,#{ lon } &radius=#{ radius } &keyword=#{ keyword } &type=#{ type } &rankby=prominence&key= #{ API_KEY } "
26+ url : "#{ ENDPOINT } /nearbysearch/json?key= #{ API_KEY } & location=#{ lat } ,#{ lon } &radius=#{ radius } &keyword=#{ keyword } &type=#{ type } &rankby=prominence"
2627 )
2728 else
2829 request = RestClient ::Request . execute (
2930 method : :get ,
30- url : "#{ ENDPOINT } /nearbysearch/json?location=#{ lat } ,#{ lon } &radius=#{ radius } &type=#{ type } &rankby=prominence&key= #{ API_KEY } "
31+ url : "#{ ENDPOINT } /nearbysearch/json?key= #{ API_KEY } & location=#{ lat } ,#{ lon } &radius=#{ radius } &type=#{ type } &rankby=prominence"
3132 )
3233 end
3334
@@ -75,7 +76,7 @@ def self.get_random_keys(place_ids, amt)
7576 def self . get_place_from_id ( place_id , properties , date , type , keyword )
7677 request = RestClient ::Request . execute (
7778 method : :get ,
78- url : "#{ ENDPOINT } /details/json?placeid =#{ place_id } &key =#{ API_KEY } "
79+ url : "#{ ENDPOINT } /details/json?key =#{ API_KEY } &placeid =#{ place_id } "
7980 )
8081 result = JSON . parse ( request ) [ "result" ]
8182 place = { }
@@ -110,7 +111,7 @@ def self.get_photo(result_photos)
110111 photo_reference = result_photos [ "photo_reference" ]
111112 max_width = result_photos [ "width" ]
112113 max_height = result_photos [ "height" ]
113- "https://maps.googleapis.com/maps/api/place/photo?maxwidth=#{ max_width } &maxheight=#{ max_height } &photoreference=#{ photo_reference } &key= #{ API_KEY } "
114+ "https://maps.googleapis.com/maps/api/place/photo?key= #{ API_KEY } & maxwidth=#{ max_width } &maxheight=#{ max_height } &photoreference=#{ photo_reference } "
114115 end
115116
116117 def self . set_start_and_end_time ( type , date , keyword )
0 commit comments