google_places 0.19.0 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGY1NTVkOWNjZDRlZjlmZTNjNzE2MmZlODg3NjNhNzM2YzIxMWE3NA==
4
+ YjkyYmFmMGFiZThlNGZkYTYyMDlkN2ZhYjIyYWI5ZTlmYjAyMDEyNw==
5
5
  data.tar.gz: !binary |-
6
- YzczNDA5NzE4ZjkxMDA4MWFlMTg5YmI5ZmQzY2EyZTI2MDE0MGZjMg==
6
+ MjM4MjUwNjA4ZjZiMWExZjliZjE5MmNjYWE2MzE4YWIwMzdlMTNiNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjJjMmNmNDkzYjkwM2VmYWFkOTVlOTY0ZWRmMTVlMjc0MDE0M2JmZmIwM2Mx
10
- Y2U5MzJiYzExNTQyNTE0MWJhOWMxY2NhMGU3MWYwM2Q5ZjhhMjM4NjU1Nzdh
11
- MmViZDk1OTI4MTVjMmY3YmE4MTBjYjEzOThmOWU1MTk0MGFlMTQ=
9
+ YmM4ZDUxNDQ0NzcwMmFhOWQ4NDg1MmQzZTA0ZWI3YmViYWI0YzE1YjM1ZGQ0
10
+ MGM5NjgzYjMzMzdkOGNmZTRmNjhmYzE1ODQ0Mzk4MTIyYTVmM2U1ZmU3OGEy
11
+ NTM5ZDY5NzJkZmNkNWI2NWRkOGU5MzE3NzAxMmQwNGI2NGViMGM=
12
12
  data.tar.gz: !binary |-
13
- OGFjOTExYzIxYWJlYjNkNDc0MDZkMGJjZWY2N2Q4ZGI1MGYzZWYzZTA2Mzgy
14
- MGRmNjhiODMxNWJjNWFhMDYxNTg1MTcwNTE4MjFjMzAyMWRjYWUyY2FjMGYy
15
- MDRlMWZjNjg3YjlkNDE0YWE3MjQzZDQwMjU2YTU4OGUxMjk2MzY=
13
+ NTE3MjhhZDliOGYzNDY3ZGNmYmI5MDY5MGI2YWU5MzE3YmRhZDU2MzljODAy
14
+ ZTIxYzc2MmM5NzU4MWE0ODJhZTcyOGM5Y2YzMjg5ODhhNmZiMWNjMzU2NzE1
15
+ OWViMzViMjQ3YTZjNTE3MWU2YTI2MWY4YTUwNzc1NWQ1MTM1ZDI=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- google_places (0.18.0)
4
+ google_places (0.19.0)
5
5
  httparty
6
6
 
7
7
  GEM
@@ -12,7 +12,7 @@ GEM
12
12
  httparty (0.11.0)
13
13
  multi_json (~> 1.0)
14
14
  multi_xml (>= 0.5.2)
15
- multi_json (1.7.9)
15
+ multi_json (1.8.2)
16
16
  multi_xml (0.5.5)
17
17
  rspec (2.11.0)
18
18
  rspec-core (~> 2.11.0)
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "google_places"
6
- s.version = '0.19.0'
6
+ s.version = '0.20.0'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Marcel de Graaf"]
9
9
  s.email = ["mail@marceldegraaf.net"]
@@ -180,5 +180,43 @@ module GooglePlaces
180
180
  def spots_by_pagetoken(pagetoken, options = {})
181
181
  Spot.list_by_pagetoken(pagetoken, @api_key, @sensor, @options.merge(options))
182
182
  end
183
+
184
+ # Radar Search Service allows you to search for up to 200 Places at once, but with less detail than is typically returned from a Text Search or Nearby Search request. The search response will include up to 200 Places, identified only by their geographic coordinates and reference. You can send a Place Details request for more information about any of them.
185
+ #
186
+ # @return [Array<Spot>]
187
+ # @param [String,Integer] lat the latitude for the search
188
+ # @param [String,Integer] lng the longitude for the search
189
+ # @param [Hash] options
190
+ # @option options [Integer] :radius (1000)
191
+ # Defines the distance (in meters) within which to return Place results.
192
+ # The maximum allowed radius is 50,000 meters.
193
+ # <b>Note that this is a mandatory parameter</b>
194
+ # @option options [String,Array] :types
195
+ # Restricts the results to Spots matching at least one of the specified types
196
+ # @option options [String] :name
197
+ # A term to be matched against the names of Places.
198
+ # Results will be restricted to those containing the passed name value.
199
+ # @option options [String] :keyword
200
+ # A term to be matched against all content that Google has indexed for this Spot,
201
+ # including but not limited to name, type, and address,
202
+ # as well as customer reviews and other third-party content.
203
+ # @option options [Integer] :minprice
204
+ # Restricts results to only those places within the specified price range. Valid values range between 0 (most affordable) to 4 (most expensive), inclusive.
205
+ # @option options [Integer] :maxprice
206
+ # Restricts results to only those places within the specified price range. Valid values range between 0 (most affordable) to 4 (most expensive), inclusive.
207
+ # @option options [Boolean] :opennow
208
+ # Retricts results to those Places that are open for business at the time the query is sent.
209
+ # Places that do not specify opening hours in the Google Places database will not be returned if you include this parameter in your query.
210
+ # Setting openNow to false has no effect.
211
+ # @option options [Boolean] :zagatselected
212
+ # Restrict your search to only those locations that are Zagat selected businesses.
213
+ # This parameter does not require a true or false value, simply including the parameter in the request is sufficient to restrict your search.
214
+ # The zagatselected parameter is experimental, and only available to Places API enterprise customers.
215
+ #
216
+ # @see https://developers.google.com/places/documentation/search#RadarSearchRequests
217
+ def spots_by_radar(lat, lng, options = {})
218
+ Spot.list_by_radar(lat, lng, @api_key, @sensor, @options.merge(options))
219
+ end
220
+
183
221
  end
184
222
  end
@@ -13,6 +13,7 @@ module GooglePlaces
13
13
  PHOTO_URL = 'https://maps.googleapis.com/maps/api/place/photo'
14
14
  TEXT_SEARCH_URL = 'https://maps.googleapis.com/maps/api/place/textsearch/json'
15
15
  PAGETOKEN_URL = 'https://maps.googleapis.com/maps/api/place/search/json'
16
+ RADAR_SEARCH_URL = 'https://maps.googleapis.com/maps/api/place/radarsearch/json'
16
17
 
17
18
  # Search for Spots at the provided location
18
19
  #
@@ -85,6 +86,53 @@ module GooglePlaces
85
86
  request.parsed_response
86
87
  end
87
88
 
89
+ # @param [Hash] options
90
+ # @option options [String] :key
91
+ # the provided api key.
92
+ # <b>Note that this is a mandatory parameter</b>
93
+ # @option options [String] :location
94
+ # the lat, lng for the search
95
+ # @option options [Boolean] :sensor
96
+ # Indicates whether or not the Place request came from a device using a location sensor (e.g. a GPS) to determine the location sent in this request.
97
+ # <b>Note that this is a mandatory parameter</b>
98
+ # @option options [Integer] :radius (1000)
99
+ # Defines the distance (in meters) within which to return Place results.
100
+ # The maximum allowed radius is 50,000 meters.
101
+ # <b>Note that this is a mandatory parameter</b>
102
+ # @option options [String,Array] :types
103
+ # Restricts the results to Spots matching at least one of the specified types
104
+ # @option options [String] :name
105
+ # A term to be matched against the names of Places.
106
+ # Results will be restricted to those containing the passed name value.
107
+ # @option options [String] :keyword
108
+ # A term to be matched against all content that Google has indexed for this Spot,
109
+ # including but not limited to name, type, and address,
110
+ # as well as customer reviews and other third-party content.
111
+ # @option options [Integer] :minprice
112
+ # Restricts results to only those places within the specified price range. Valid values range between 0 (most affordable) to 4 (most expensive), inclusive.
113
+ # @option options [Integer] :maxprice
114
+ # Restricts results to only those places within the specified price range. Valid values range between 0 (most affordable) to 4 (most expensive), inclusive.
115
+ # @option options [Boolean] :opennow
116
+ # Retricts results to those Places that are open for business at the time the query is sent.
117
+ # Places that do not specify opening hours in the Google Places database will not be returned if you include this parameter in your query.
118
+ # Setting openNow to false has no effect.
119
+ # @option options [Boolean] :zagatselected
120
+ # Restrict your search to only those locations that are Zagat selected businesses.
121
+ # This parameter does not require a true or false value, simply including the parameter in the request is sufficient to restrict your search.
122
+ # The zagatselected parameter is experimental, and only available to Places API enterprise customers.
123
+ # @option options [Hash] :retry_options ({})
124
+ # A Hash containing parameters for search retries
125
+ # @option options [Object] :retry_options[:status] ([])
126
+ # @option options [Integer] :retry_options[:max] (0) the maximum retries
127
+ # @option options [Integer] :retry_options[:delay] (5) the delay between each retry in seconds
128
+ #
129
+ # @see https://developers.google.com/places/documentation/search#RadarSearchRequests Radar Search
130
+ # @see https://developers.google.com/maps/documentation/places/supported_types List of supported types
131
+ def self.spots_by_radar(options = {})
132
+ request = new(RADAR_SEARCH_URL, options)
133
+ request.parsed_response
134
+ end
135
+
88
136
  # Search for Spots with a query
89
137
  #
90
138
  # @return [Array<Spot>]
@@ -87,6 +87,89 @@ module GooglePlaces
87
87
  request(:spots, multipage_request, exclude, options)
88
88
  end
89
89
 
90
+ # Search for Spots using Radar Search. Spots will only include reference and lat/lng information. You can send a Place Details request for more information about any of them.
91
+ #
92
+ # @return [Array<Spot>]
93
+ # @param [String,Integer] lat the latitude for the search
94
+ # @param [String,Integer] lng the longitude for the search
95
+ # @param [String] api_key the provided api key
96
+ # @param [Boolean] sensor
97
+ # Indicates whether or not the Place request came from a device using a location sensor (e.g. a GPS) to determine the location sent in this request.
98
+ # <b>Note that this is a mandatory parameter</b>
99
+ # @param [Hash] options
100
+ # @option options [Integer] :radius (1000)
101
+ # Defines the distance (in meters) within which to return Place results.
102
+ # The maximum allowed radius is 50,000 meters.
103
+ # <b>Note that this is a mandatory parameter</b>
104
+ # @option options [String,Array] :types
105
+ # Restricts the results to Spots matching at least one of the specified types
106
+ # @option options [String] :name
107
+ # A term to be matched against the names of Places.
108
+ # Results will be restricted to those containing the passed name value.
109
+ # @option options [String] :keyword
110
+ # A term to be matched against all content that Google has indexed for this Spot,
111
+ # including but not limited to name, type, and address,
112
+ # as well as customer reviews and other third-party content.
113
+ # @option options [Integer] :minprice
114
+ # Restricts results to only those places within the specified price range. Valid values range between 0 (most affordable) to 4 (most expensive), inclusive.
115
+ # @option options [Integer] :maxprice
116
+ # Restricts results to only those places within the specified price range. Valid values range between 0 (most affordable) to 4 (most expensive), inclusive.
117
+ # @option options [Boolean] :opennow
118
+ # Retricts results to those Places that are open for business at the time the query is sent.
119
+ # Places that do not specify opening hours in the Google Places database will not be returned if you include this parameter in your query.
120
+ # Setting openNow to false has no effect.
121
+ # @option options [Boolean] :zagatselected
122
+ # Restrict your search to only those locations that are Zagat selected businesses.
123
+ # This parameter does not require a true or false value, simply including the parameter in the request is sufficient to restrict your search.
124
+ # The zagatselected parameter is experimental, and only available to Places API enterprise customers.
125
+ # @option options [Hash] :retry_options ({})
126
+ # A Hash containing parameters for search retries
127
+ # @option options [Object] :retry_options[:status] ([])
128
+ # @option options [Integer] :retry_options[:max] (0) the maximum retries
129
+ # @option options [Integer] :retry_options[:delay] (5) the delay between each retry in seconds
130
+ #
131
+ # @see https://developers.google.com/places/documentation/search#RadarSearchRequests Radar Search
132
+ # @see https://developers.google.com/maps/documentation/places/supported_types List of supported types
133
+ def self.list_by_radar(lat, lng, api_key, sensor, options = {})
134
+ location = Location.new(lat, lng)
135
+ multipage_request = !!options.delete(:multipage)
136
+ radius = options.delete(:radius) || 1000
137
+ types = options.delete(:types)
138
+ name = options.delete(:name)
139
+ keyword = options.delete(:keyword)
140
+ retry_options = options.delete(:retry_options) || {}
141
+ zagat_selected = options.delete(:zagat_selected) || false
142
+ opennow = options.delete(:opennow) || false
143
+ minprice = options.delete(:minprice) || false
144
+ maxprice = options.delete(:maxprice) || false
145
+ exclude = []
146
+
147
+ options = {
148
+ :location => location.format,
149
+ :radius => radius,
150
+ :sensor => sensor,
151
+ :key => api_key,
152
+ :name => name,
153
+ :keyword => keyword,
154
+ :retry_options => retry_options
155
+ }
156
+
157
+ options[:zagatselected] = zagat_selected if zagat_selected
158
+ options[:opennow] = opennow if opennow
159
+ options[:minprice] = minprice if minprice
160
+ options[:maxprice] = maxprice if maxprice
161
+
162
+ # Accept Types as a string or array
163
+ if types
164
+ types = (types.is_a?(Array) ? types.join('|') : types)
165
+ options.merge!(:types => types)
166
+ end
167
+
168
+ request(:spots_by_radar, multipage_request, exclude, options)
169
+ end
170
+
171
+
172
+
90
173
  # Search for a Spot with a reference key
91
174
  #
92
175
  # @return [Spot]
@@ -30,4 +30,16 @@ describe GooglePlaces::Client do
30
30
 
31
31
  @client.spots_by_query(query)
32
32
  end
33
+
34
+ it 'should request spots by radar' do
35
+ keywords = "landmarks"
36
+ lat, lng = '51.511627', '-0.183778'
37
+ radius = 5000
38
+ @client = GooglePlaces::Client.new(api_key)
39
+ GooglePlaces::Spot.should_receive(:list_by_radar).with(lat, lng, api_key, false, {:radius=> radius, :keyword => keywords})
40
+
41
+ @client.spots_by_radar(lat, lng, :radius => radius, :keyword => keywords)
42
+ end
43
+
44
+
33
45
  end
@@ -9,6 +9,7 @@ describe GooglePlaces::Request do
9
9
  @sensor = false
10
10
  @reference = "CnRsAAAASc4grenwL0h3X5VPNp5fkDNfqbjt3iQtWIPlKS-3ms9GbnCxR_FLHO0B0ZKCgJSg19qymkeHagjQFB4aUL87yhp4mhFTc17DopK1oiYDaeGthztSjERic8TmFNe-6zOpKSdiZWKE6xlQvcbSiWIJchIQOEYZqunSSZqNDoBSs77bWRoUJcMMVANtSlhy0llKI0MI6VcC7DU"
11
11
  @reference_not_found = "CnRpAAAAlO2WvF_4eOqp02TAWKsXpPSCFz8KxBjraWhB4MSvdUPqXN0yCpxQgblam1LeRENcWZF-9-2CEfUwlHUli61PaYe0e7dUPAU302tk6KkalnKqx7nv07iFA1Ca_Y1WoCLH9adEWwkxKMITlbGhUUz9-hIQPxQ4Bp_dz5nHloUFkj3rkBoUDSPqy2smqMnPEo4ayfbDupeKEZY"
12
+ @keyword = "attractions"
12
13
  end
13
14
 
14
15
  context 'Listing spots' do
@@ -241,4 +242,105 @@ describe GooglePlaces::Request do
241
242
  end
242
243
  end
243
244
 
245
+
246
+
247
+ context 'Listing spots by radar' do
248
+ use_vcr_cassette 'list_spots_by_radar'
249
+
250
+ context 'with valid options' do
251
+ context 'with keyword' do
252
+ it do
253
+ response = GooglePlaces::Request.spots_by_radar(
254
+ :location => @location,
255
+ :keyword => @keyword,
256
+ :radius => @radius,
257
+ :sensor => @sensor,
258
+ :key => api_key
259
+ )
260
+ response['results'].should_not be_empty
261
+ end
262
+ end
263
+
264
+ context 'with name' do
265
+ it do
266
+ response = GooglePlaces::Request.spots_by_radar(
267
+ :location => @location,
268
+ :name => 'park',
269
+ :radius => @radius,
270
+ :sensor => @sensor,
271
+ :key => api_key
272
+ )
273
+ response['results'].should_not be_empty
274
+ end
275
+ end
276
+ end
277
+
278
+ context 'with missing sensor' do
279
+ it do
280
+ lambda {
281
+ GooglePlaces::Request.spots_by_radar(
282
+ :location => @location,
283
+ :keyword => @keyword,
284
+ :radius => @radius,
285
+ :key => api_key
286
+ )
287
+ }.should raise_error GooglePlaces::RequestDeniedError
288
+ end
289
+ end
290
+
291
+ context 'without keyword' do
292
+ context 'without retry options' do
293
+ it do
294
+ lambda {
295
+ GooglePlaces::Request.spots_by_radar(
296
+ :location => @location,
297
+ :radius => @radius,
298
+ :sensor => @sensor,
299
+ :key => api_key
300
+ )
301
+ }.should raise_error GooglePlaces::InvalidRequestError
302
+ end
303
+ end
304
+
305
+ context 'with retry options' do
306
+ context 'without timeout' do
307
+ it do
308
+ lambda {
309
+ GooglePlaces::Request.spots_by_radar(
310
+ :location => @location,
311
+ :radius => @radius,
312
+ :sensor => @sensor,
313
+ :key => api_key,
314
+ :retry_options => {
315
+ :max => 3,
316
+ :status => 'INVALID_REQUEST',
317
+ :delay => 1
318
+ }
319
+ )
320
+ }.should raise_error GooglePlaces::RetryError
321
+ end
322
+ end
323
+
324
+ context 'with timeout' do
325
+ it do
326
+ lambda {
327
+ GooglePlaces::Request.spots_by_radar(
328
+ :location => @location,
329
+ :radius => @radius,
330
+ :sensor => @sensor,
331
+ :key => api_key,
332
+ :retry_options => {
333
+ :max => 3,
334
+ :status => 'INVALID_REQUEST',
335
+ :delay => 10,
336
+ :timeout => 1
337
+ }
338
+ )
339
+ }.should raise_error GooglePlaces::RetryTimeoutError
340
+ end
341
+ end
342
+ end
343
+ end
344
+ end
345
+
244
346
  end
@@ -182,6 +182,19 @@ describe GooglePlaces::Spot do
182
182
 
183
183
  end
184
184
 
185
+ context 'List spots by radar' do
186
+ use_vcr_cassette 'list_spots_by_radar'
187
+
188
+ after(:each) do
189
+ @collection.map(&:class).uniq.should == [GooglePlaces::Spot]
190
+ end
191
+
192
+ it 'should be a collection of Spots' do
193
+ @collection = GooglePlaces::Spot.list_by_radar('48.8567', '2.3508', api_key, @sensor, :radius => @radius, :keyword => 'attractions')
194
+ end
195
+
196
+ end
197
+
185
198
  context 'Find a single spot' do
186
199
  use_vcr_cassette 'single_spot'
187
200
  before :each do
@@ -0,0 +1,536 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://maps.googleapis.com/maps/api/place/radarsearch/json?radius=200&sensor=false&key=AIzaSyDPVYhZDzHdxRGnqqHZSWccL-BEe-JSYXA&location=-33.86705220%2C151.19573620&keyword=attractions
6
+ body:
7
+ string: ""
8
+ headers: {}
9
+
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ server:
16
+ - mafe
17
+ x-frame-options:
18
+ - SAMEORIGIN
19
+ date:
20
+ - Tue, 29 Oct 2013 19:06:12 GMT
21
+ expires:
22
+ - Tue, 29 Oct 2013 19:11:12 GMT
23
+ alternate-protocol:
24
+ - 443:quic
25
+ cache-control:
26
+ - public, max-age=300
27
+ content-type:
28
+ - application/json; charset=UTF-8
29
+ vary:
30
+ - Accept-Language
31
+ x-xss-protection:
32
+ - 1; mode=block
33
+ connection:
34
+ - close
35
+ body:
36
+ string: |
37
+ {
38
+ "debug_info" : [],
39
+ "html_attributions" : [
40
+ "Listings by \u003ca href=\"http://www.yellowpages.com.au/\"\u003eYellow Pages\u003c/a\u003e"
41
+ ],
42
+ "results" : [
43
+ {
44
+ "geometry" : {
45
+ "location" : {
46
+ "lat" : -33.868232,
47
+ "lng" : 151.194478
48
+ }
49
+ },
50
+ "id" : "44fdc977984610cd873c790a7d850e8185ed0e5e",
51
+ "reference" : "CnRwAAAA-IgRxfgFtzLhPlNmkX9vMET-A1YZ-VIcbJ0PDx02a8TGTTfLU5gmZCw5bV393p3xhbLx6OXAQq4YXk_bJSzaXEwJgInlmOVPJqmyQ_ov-BQ-ktAGhf5k4QRY2ebQV6c-_cO-AkftP47CWxUXk-BPkhIQavH6iEOSo9uZlHqe3Ztn-RoUFBYp3JkHc-ptAoo0CPTwe1zoRic"
52
+ },
53
+ {
54
+ "geometry" : {
55
+ "location" : {
56
+ "lat" : -33.869509,
57
+ "lng" : 151.198637
58
+ }
59
+ },
60
+ "id" : "45ffedee792e73666af7df087facf2ddb4509085",
61
+ "reference" : "CpQBhAAAAJSORh4hOXm2Rew5IJEQEus8dEcCUqVuJC3sCDTd2NACoMRd1wMB4Lk8sguO6ZivmrkZVTV_Xor7U-qw9yai2R4OzIGheRtP84UdJVBa9CA--3SXBbZgFHELi-VhJ6EFbu7o_AOiQ6S7nh57oMYdkDFrxQhZ7xh2u1bJmg9TK3nt0m0CeV95AJB33IcXWLxcWxIQhdybD0MIyrsHTJD1lcXrrRoU4iFZ8u667KzBcGd11h46v2HPB5E"
62
+ },
63
+ {
64
+ "geometry" : {
65
+ "location" : {
66
+ "lat" : -33.86812,
67
+ "lng" : 151.194621
68
+ }
69
+ },
70
+ "id" : "e3967e350d643656fea1ca10447481f3ff53c7f1",
71
+ "reference" : "CnRwAAAAEG7brzOu-weRCLZPdKN-hZaTawVZBkN7UXo6lpEH8lV1Lh9Gj03H1B264zoaL-LIK0NxmBT7OjU9uqkxejwijGw4SXg6yo5Nw2eGJoixUq6A31L9Don7wGZ6RM59XX8qH1rIsTeOezE-j9pryaMzQxIQKjqsVwe86dde4J63mgzFuxoUGwfDTsvFga973KOmIDhS8-CksXs"
72
+ },
73
+ {
74
+ "geometry" : {
75
+ "location" : {
76
+ "lat" : -33.870402,
77
+ "lng" : 151.195625
78
+ }
79
+ },
80
+ "id" : "577effa2782d13462f71bb05c44f7c216ab9c17c",
81
+ "reference" : "CpQBiAAAACtkNVJMdsuoucC0vmnHIU55tI62brRHGilvpXG4FrKpyT0LIBsd1AWh9V5TClJYVNn_VMrOd6btC0oRcP_mIoJcq4d9DeOStohYnsDHLk7KcqVrbYfDU79p-g6e7CsxDBZ2zhUUHnWdAsg5rNmzG2i3oeSVxRpW3MwmKGXFF7no_M9-mKRRxbQw7Pmhh99c0RIQEWF6geOq-swjHi-DZ7tvlxoUABJvB3Uxeomhw1XuUSfP-Lo6UAc"
82
+ },
83
+ {
84
+ "geometry" : {
85
+ "location" : {
86
+ "lat" : -33.868507,
87
+ "lng" : 151.195351
88
+ }
89
+ },
90
+ "id" : "59177146e087d57b2771e1df7db2f9ea25ee3787",
91
+ "reference" : "CnRrAAAAO31i8t-eb5psr3PHcoEAPlUyf_EI-imtR2pRas9skerqL6tI4q2V4hzoxhDUJeza8wFs0jw9IZPf6y1674g091sxwBaXak2tdNH2rJCVMqcWpCvDgGPDvz6lei9T9LBc1Y4ukWOIOQPaiyyuK1-4cxIQgJIeMvEF5kPPXtrnRYzsgxoU2JIe-O6_zzI9xdnLfmwU1QUMKzE"
92
+ },
93
+ {
94
+ "geometry" : {
95
+ "location" : {
96
+ "lat" : -33.867698,
97
+ "lng" : 151.1983
98
+ }
99
+ },
100
+ "id" : "a0fe38c2bc73a293b249eb6bcf594d48b7b05890",
101
+ "reference" : "CpQBhQAAAKz9zqNp8wXog_hjOGnV_Yy9EpeFjyQz0dA7WMr0I1uQ4xkLPQ3F0EV3IDWP861E40Cf_TmK3bF7ZzcTxb2ath7k9gOcscQeTwVJAlVTHI0Ukq3OUn1D3wH3HLjjxCaJW8ObSBZEOSu0mXeT5H-AaArCgNrn0rkLPKUql_QVGJQ_Dlg8c3jb_z_r9q2SnmKrHhIQMNs-darlsZHtgna2cFvJuhoULAX-4ZdcprY8HtHo4mtAJTfbvvA"
102
+ },
103
+ {
104
+ "geometry" : {
105
+ "location" : {
106
+ "lat" : -33.868207,
107
+ "lng" : 151.194672
108
+ }
109
+ },
110
+ "id" : "464296496d3757a4a1543d5883fe545b6d1442ac",
111
+ "reference" : "CoQBdwAAAAPoMuH5ZODwAlgby9IzovaFLo_uOOE-AMshbqIYaL7HhK-PtWEdrhIWK3NgvgAv43pZ_U3K8zkUJS5RG3_Vwp3WIlNUu6XGP211frylyjbbyZrwHRJRC4C24KZNuBT0He_AmA4gjrrktUOUF8TDYOxJyXaiOxzyWDw8OzzEbZzPEhC1otNsigSrYGKtHo2At3emGhQ7RYqNiWPt0HdmwlSSVwwAJdsgEA"
112
+ },
113
+ {
114
+ "geometry" : {
115
+ "location" : {
116
+ "lat" : -33.865671,
117
+ "lng" : 151.193271
118
+ }
119
+ },
120
+ "id" : "3c668e33631e31fed723fce43d3e9864ad215bb4",
121
+ "reference" : "CnRrAAAAJdI3-nCxHupXx4olPZgDoesSLtXtrjTHpvMLBnlACStbMKcnHuc-BXZ1jlPFlO2dHxUu_nDAeUO7gP4nsKpYof7QzTDzIp9WHb0aiUlazyfWI2_gnbmQbTYEvQYUgR-ptbrZ8PR2YzDxpJ0DP9p6ThIQhONLVResw5xo3Irrlv0e6RoUeTsvfgv-x4lmrNVMOrRg_Mnm4f8"
122
+ },
123
+ {
124
+ "geometry" : {
125
+ "location" : {
126
+ "lat" : -33.868143,
127
+ "lng" : 151.192088
128
+ }
129
+ },
130
+ "id" : "d4e8c7327c1e3e47838e7303dde8d51f3eddc5dc",
131
+ "reference" : "CpQBgQAAAPNP2ABsyw3bZNxMh8eTnLVORo-ecNkRbhVwPj-jnOR1P0ssMqzGtGduMXPePbznJDQ-6jwdTb_09Q1IHgpTL1UjE9YVAIkb0LK1KqHOq6yzzEmFFhSaTkT-aK5Q4w6Z7EuxqE-dfPpODxrOXrvpLMcoIwn7TpgoOxr_3rHnOvPs62Q7x70JK6KYV6LyCgG6KhIQSnYYu4FnNjJmXWx6WAGWphoUCaikCpE7Sf_A-USHUCnNMLSE6Es"
132
+ },
133
+ {
134
+ "geometry" : {
135
+ "location" : {
136
+ "lat" : -33.863503,
137
+ "lng" : 151.194921
138
+ }
139
+ },
140
+ "id" : "7559167d3650dc2af65aefcceb62782ab627105c",
141
+ "reference" : "CoQBdAAAAP5mOf6b8MN4xwitNAw4jyvSDCaqwu_4EpMS00rv-_iHgVWRm8kwJmluoBz-3Ri9fsVR1a2e83BrnVnghp6oTFF_yoTk8MNCnM_YzY0Nq6FCFHFYAMh7ZCBcKZ5I_GAlXjLFskF_cjUhawQS-4PUza2fPMbe4ARm49PTgdflBcaLEhDF8lrZY3vQWkjTJB96CfyzGhQ_rK7Xh4A5cUJht5UruzA5Ek-adA"
142
+ }
143
+ ],
144
+ "status" : "OK"
145
+ }
146
+
147
+ http_version: "1.1"
148
+ recorded_at: Tue, 29 Oct 2013 19:06:12 GMT
149
+ - request:
150
+ method: get
151
+ uri: https://maps.googleapis.com/maps/api/place/radarsearch/json?radius=200&key=AIzaSyDPVYhZDzHdxRGnqqHZSWccL-BEe-JSYXA&location=-33.86705220%2C151.19573620&keyword=attractions
152
+ body:
153
+ string: ""
154
+ headers: {}
155
+
156
+ response:
157
+ status:
158
+ code: 200
159
+ message: OK
160
+ headers:
161
+ server:
162
+ - mafe
163
+ x-frame-options:
164
+ - SAMEORIGIN
165
+ date:
166
+ - Tue, 29 Oct 2013 19:06:12 GMT
167
+ expires:
168
+ - Fri, 01 Jan 1990 00:00:00 GMT
169
+ alternate-protocol:
170
+ - 443:quic
171
+ cache-control:
172
+ - no-cache, must-revalidate
173
+ content-type:
174
+ - application/json; charset=UTF-8
175
+ vary:
176
+ - Accept-Language
177
+ x-xss-protection:
178
+ - 1; mode=block
179
+ pragma:
180
+ - no-cache
181
+ connection:
182
+ - close
183
+ body:
184
+ string: |
185
+ {
186
+ "debug_info" : [],
187
+ "html_attributions" : [],
188
+ "results" : [],
189
+ "status" : "REQUEST_DENIED"
190
+ }
191
+
192
+ http_version: "1.1"
193
+ recorded_at: Tue, 29 Oct 2013 19:06:13 GMT
194
+ - request:
195
+ method: get
196
+ uri: https://maps.googleapis.com/maps/api/place/radarsearch/json?radius=200&sensor=false&key=AIzaSyDPVYhZDzHdxRGnqqHZSWccL-BEe-JSYXA&location=-33.86705220%2C151.19573620
197
+ body:
198
+ string: ""
199
+ headers: {}
200
+
201
+ response:
202
+ status:
203
+ code: 200
204
+ message: OK
205
+ headers:
206
+ server:
207
+ - mafe
208
+ x-frame-options:
209
+ - SAMEORIGIN
210
+ date:
211
+ - Tue, 29 Oct 2013 19:06:13 GMT
212
+ expires:
213
+ - Tue, 29 Oct 2013 19:11:13 GMT
214
+ alternate-protocol:
215
+ - 443:quic
216
+ cache-control:
217
+ - public, max-age=300
218
+ content-type:
219
+ - application/json; charset=UTF-8
220
+ vary:
221
+ - Accept-Language
222
+ x-xss-protection:
223
+ - 1; mode=block
224
+ connection:
225
+ - close
226
+ body:
227
+ string: |
228
+ {
229
+ "debug_info" : [],
230
+ "html_attributions" : [],
231
+ "results" : [],
232
+ "status" : "INVALID_REQUEST"
233
+ }
234
+
235
+ http_version: "1.1"
236
+ recorded_at: Tue, 29 Oct 2013 19:06:13 GMT
237
+ - request:
238
+ method: get
239
+ uri: https://maps.googleapis.com/maps/api/place/radarsearch/json?radius=200&sensor=false&key=AIzaSyDPVYhZDzHdxRGnqqHZSWccL-BEe-JSYXA&location=-33.86705220%2C151.19573620
240
+ body:
241
+ string: ""
242
+ headers: {}
243
+
244
+ response:
245
+ status:
246
+ code: 200
247
+ message: OK
248
+ headers:
249
+ server:
250
+ - mafe
251
+ x-frame-options:
252
+ - SAMEORIGIN
253
+ date:
254
+ - Tue, 29 Oct 2013 19:06:14 GMT
255
+ expires:
256
+ - Tue, 29 Oct 2013 19:11:14 GMT
257
+ alternate-protocol:
258
+ - 443:quic
259
+ cache-control:
260
+ - public, max-age=300
261
+ content-type:
262
+ - application/json; charset=UTF-8
263
+ vary:
264
+ - Accept-Language
265
+ x-xss-protection:
266
+ - 1; mode=block
267
+ connection:
268
+ - close
269
+ body:
270
+ string: |
271
+ {
272
+ "debug_info" : [],
273
+ "html_attributions" : [],
274
+ "results" : [],
275
+ "status" : "INVALID_REQUEST"
276
+ }
277
+
278
+ http_version: "1.1"
279
+ recorded_at: Tue, 29 Oct 2013 19:06:14 GMT
280
+ - request:
281
+ method: get
282
+ uri: https://maps.googleapis.com/maps/api/place/radarsearch/json?radius=200&sensor=false&key=AIzaSyDPVYhZDzHdxRGnqqHZSWccL-BEe-JSYXA&location=-33.86705220%2C151.19573620
283
+ body:
284
+ string: ""
285
+ headers: {}
286
+
287
+ response:
288
+ status:
289
+ code: 200
290
+ message: OK
291
+ headers:
292
+ server:
293
+ - mafe
294
+ x-frame-options:
295
+ - SAMEORIGIN
296
+ date:
297
+ - Tue, 29 Oct 2013 19:06:15 GMT
298
+ expires:
299
+ - Tue, 29 Oct 2013 19:11:15 GMT
300
+ alternate-protocol:
301
+ - 443:quic
302
+ cache-control:
303
+ - public, max-age=300
304
+ content-type:
305
+ - application/json; charset=UTF-8
306
+ vary:
307
+ - Accept-Language
308
+ x-xss-protection:
309
+ - 1; mode=block
310
+ connection:
311
+ - close
312
+ body:
313
+ string: |
314
+ {
315
+ "debug_info" : [],
316
+ "html_attributions" : [],
317
+ "results" : [],
318
+ "status" : "INVALID_REQUEST"
319
+ }
320
+
321
+ http_version: "1.1"
322
+ recorded_at: Tue, 29 Oct 2013 19:06:15 GMT
323
+ - request:
324
+ method: get
325
+ uri: https://maps.googleapis.com/maps/api/place/radarsearch/json?radius=200&sensor=false&key=AIzaSyDPVYhZDzHdxRGnqqHZSWccL-BEe-JSYXA&location=-33.86705220%2C151.19573620
326
+ body:
327
+ string: ""
328
+ headers: {}
329
+
330
+ response:
331
+ status:
332
+ code: 200
333
+ message: OK
334
+ headers:
335
+ server:
336
+ - mafe
337
+ x-frame-options:
338
+ - SAMEORIGIN
339
+ date:
340
+ - Tue, 29 Oct 2013 19:06:16 GMT
341
+ expires:
342
+ - Tue, 29 Oct 2013 19:11:16 GMT
343
+ alternate-protocol:
344
+ - 443:quic
345
+ cache-control:
346
+ - public, max-age=300
347
+ content-type:
348
+ - application/json; charset=UTF-8
349
+ vary:
350
+ - Accept-Language
351
+ x-xss-protection:
352
+ - 1; mode=block
353
+ connection:
354
+ - close
355
+ body:
356
+ string: |
357
+ {
358
+ "debug_info" : [],
359
+ "html_attributions" : [],
360
+ "results" : [],
361
+ "status" : "INVALID_REQUEST"
362
+ }
363
+
364
+ http_version: "1.1"
365
+ recorded_at: Tue, 29 Oct 2013 19:06:16 GMT
366
+ - request:
367
+ method: get
368
+ uri: https://maps.googleapis.com/maps/api/place/radarsearch/json?radius=200&sensor=false&key=AIzaSyDPVYhZDzHdxRGnqqHZSWccL-BEe-JSYXA&location=-33.86705220%2C151.19573620&name=park
369
+ body:
370
+ string: ""
371
+ headers: {}
372
+
373
+ response:
374
+ status:
375
+ code: 200
376
+ message: OK
377
+ headers:
378
+ server:
379
+ - mafe
380
+ x-frame-options:
381
+ - SAMEORIGIN
382
+ date:
383
+ - Tue, 29 Oct 2013 20:18:08 GMT
384
+ expires:
385
+ - Tue, 29 Oct 2013 20:23:08 GMT
386
+ alternate-protocol:
387
+ - 443:quic
388
+ cache-control:
389
+ - public, max-age=300
390
+ content-type:
391
+ - application/json; charset=UTF-8
392
+ vary:
393
+ - Accept-Language
394
+ x-xss-protection:
395
+ - 1; mode=block
396
+ connection:
397
+ - close
398
+ body:
399
+ string: |
400
+ {
401
+ "debug_info" : [],
402
+ "html_attributions" : [
403
+ "Listings by \u003ca href=\"http://www.yellowpages.com.au/\"\u003eYellow Pages\u003c/a\u003e"
404
+ ],
405
+ "results" : [
406
+ {
407
+ "geometry" : {
408
+ "location" : {
409
+ "lat" : -33.868046,
410
+ "lng" : 151.196949
411
+ }
412
+ },
413
+ "id" : "d7f221892dcdb49e5c5eda856dc58661e5bd76e9",
414
+ "reference" : "CoQBcgAAACgj_2eZ8iqODG3T5W6qAuP2AHFtsO6Ob-A77akKBqWJApHMrrD05JW12y3hE7jtEp6pNxrP8fS-7ZcFibatQpw-Qgvnbnot_Yc25fAmtcwEoobmVZjmF_RfJstKkU51y4mPnrGE2LGXDG5bW2zhEzYpG2hKup2QNJRfqOF6CgJyEhB2fR4QDPoWTH4G720DwZAFGhRu7vf48APsWe1CSgdIMnUvSWuLAg"
415
+ },
416
+ {
417
+ "geometry" : {
418
+ "location" : {
419
+ "lat" : -33.865849,
420
+ "lng" : 151.195856
421
+ }
422
+ },
423
+ "id" : "a4d68c2fd5ab56d686de82ac49bc69b43d50c032",
424
+ "reference" : "CnRvAAAATWfTFGOnMwkx7yfVy8yfMZSwbnp1SlnaYwrACMWAKriDHY09ofuLezHI1zPO4YGXaRRzyt7fhfKv2PbBIdeOZrYG7DAWK0k0Il0SNv5K2hBOjpoGh0J_Nd8kL4eQB152InwCTYZNuRXniXBKIxRAJhIQx7_JbD8jX-C6V9polHAqzxoU85btSRmlrJjzy6cGDrfpgpqGOUw"
425
+ },
426
+ {
427
+ "geometry" : {
428
+ "location" : {
429
+ "lat" : -33.864857,
430
+ "lng" : 151.191858
431
+ }
432
+ },
433
+ "id" : "8fcd6dc5718eab374670af4961745e0444c92292",
434
+ "reference" : "CnRuAAAAgZQMEoq5d-1_G_QnnNURx-jKThLkVz3-pXYs2Hk2z3O1YDzWahAMe-GvjP7apSj5vwlGqfIurGnFJ61cGFIp3wppjMORDlXe2vUMijwrX8l_B74oBSGPrn9xRVeeE6fMkFg4Nty8gRiE3eIWF9umgBIQi8IsD9898u2y4MwwjUtVbRoUuVrdP6KSrhTCCWOVJxj8lksh8qE"
435
+ },
436
+ {
437
+ "geometry" : {
438
+ "location" : {
439
+ "lat" : -33.863992,
440
+ "lng" : 151.19704
441
+ }
442
+ },
443
+ "id" : "36062a37400be080f019a9a2b0f42deb27e610d8",
444
+ "reference" : "CnRvAAAA-6kn6Vw6yxyFO4cY2nio0I14Vbovvzz5omAL6xQ1JgSyuiJ_9Fy1WFv5FECkFPyqosMIZYMbo9m7pEUPeKXhuslCWc7RSBSPwnXxnIsplPE6wlD1LA8ZLsHsZomTXxGkTR5KI4-AbH7qv_nEmOlLaxIQlvenWKwBLWZDwuHQonbirBoUN0qpeBgD1rpEIr1z4Xr9pqV_6Hs"
445
+ },
446
+ {
447
+ "geometry" : {
448
+ "location" : {
449
+ "lat" : -33.864056,
450
+ "lng" : 151.192578
451
+ }
452
+ },
453
+ "id" : "a11203b5b295fbea044d0878584e3063d5d4fbad",
454
+ "reference" : "CnRrAAAAv3tPFvWx87joAyB7P3OtS8A0Fqu0Ox3_70cWwOLQyqPWmzrUca2LGjK2E2KD2vOgPZoyBvMgM30iwONlm7YY4Qo34h3WLGFsj2UYLb1dRMAj7dEjs7arc1eYySLCOLNP7SjtanATS8K-kUlemhv-zxIQNBHkpdTis6u9F30a6iUKUhoULAv13Pz7uHySt0kVUDd86dGbZlo"
455
+ },
456
+ {
457
+ "geometry" : {
458
+ "location" : {
459
+ "lat" : -33.8697,
460
+ "lng" : 151.194973
461
+ }
462
+ },
463
+ "id" : "cf70bba9f870e5876154d50d461707c38ff272e7",
464
+ "reference" : "CoQBewAAAN8Va0hfQ48Ctiw7OO1YXQTHcTpMKnjZdj3R6l82JBiJkaUA8MxAacrGODBdB5Dc3QApgO_gimZTCY3k05tdCV6IUdZ0FZKH6xk7TiAyhBDmmJSvwBX-nL4ZA455mQHjalattt2dJlqK3B-CMRIHeM9s5O8zNgc8ICOe6l9zS9V9EhDVnFcgVTcGhnXLB9NAGXUFGhQfDancbGeubD8PgXn0G00Y5eU20g"
465
+ }
466
+ ],
467
+ "status" : "OK"
468
+ }
469
+
470
+ http_version: "1.1"
471
+ recorded_at: Tue, 29 Oct 2013 20:18:08 GMT
472
+ - request:
473
+ method: get
474
+ uri: https://maps.googleapis.com/maps/api/place/radarsearch/json?radius=200&key=AIzaSyDPVYhZDzHdxRGnqqHZSWccL-BEe-JSYXA&location=48.85670000%2C2.35080000&keyword=attractions&sensor=false&name=
475
+ body:
476
+ string: ""
477
+ headers: {}
478
+
479
+ response:
480
+ status:
481
+ code: 200
482
+ message: OK
483
+ headers:
484
+ server:
485
+ - mafe
486
+ x-frame-options:
487
+ - SAMEORIGIN
488
+ date:
489
+ - Tue, 29 Oct 2013 20:31:57 GMT
490
+ expires:
491
+ - Tue, 29 Oct 2013 20:36:57 GMT
492
+ alternate-protocol:
493
+ - 443:quic
494
+ cache-control:
495
+ - public, max-age=300
496
+ content-type:
497
+ - application/json; charset=UTF-8
498
+ x-xss-protection:
499
+ - 1; mode=block
500
+ vary:
501
+ - Accept-Language
502
+ connection:
503
+ - close
504
+ body:
505
+ string: |
506
+ {
507
+ "debug_info" : [],
508
+ "html_attributions" : [],
509
+ "results" : [
510
+ {
511
+ "geometry" : {
512
+ "location" : {
513
+ "lat" : 48.853652,
514
+ "lng" : 2.347715
515
+ }
516
+ },
517
+ "id" : "451a0ef9094206e1dfc0790b27b0c90fd926ae22",
518
+ "reference" : "CpQBjwAAANzTVBOjI0CCwu3zFMkY6YEtCQdlGsDhfwWhy4oze0iZr4JYf8jWXaaWI6aRVJJ3R0SKGHQmnuimy2LhnqZmKiy7G7ayGYa5TOQASwLlxWxeKWgG2CV6Yfvre00mR_3370aJcvxs85Bx-gProcNe80GTN8cdnFz33THU1BZfbxM0ewFYOU9Pur6JyHbje1ip4xIQXEUw3c7o9iRI65k5kY2SXxoUc_qBfIbYRlA1EqqCwtarSiAq3Qk"
519
+ },
520
+ {
521
+ "geometry" : {
522
+ "location" : {
523
+ "lat" : 48.859817,
524
+ "lng" : 2.347824
525
+ }
526
+ },
527
+ "id" : "1db596e607e4c1451e1c9f267ad30e45657185d9",
528
+ "reference" : "CoQBcQAAAHzs28hO8fvxWt5n5SdHDMlcrDQ3uTp3ajPL_Ddz0WCEDcqSGuXbyt-W-_pbTJNWuf9fjyYfmDnCUsBN8hsjJOhTG7y0nBS21TO9uUzjUdekaxP05s0jTlrTfNJl5z129NOlVAc8SzbCTpLvOloStnUx0eY7UJuZbF-kPzEf2VVREhDqZPMa6bOiseUZ2VaE6LttGhSMz3BzXqFs4XHmdyRqnHmzeazXUg"
529
+ }
530
+ ],
531
+ "status" : "OK"
532
+ }
533
+
534
+ http_version: "1.1"
535
+ recorded_at: Tue, 29 Oct 2013 20:31:57 GMT
536
+ recorded_with: VCR 2.2.5
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_places
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcel de Graaf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-18 00:00:00.000000000 Z
11
+ date: 2013-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -100,6 +100,7 @@ files:
100
100
  - spec/google_places/spot_spec.rb
101
101
  - spec/spec_helper.rb
102
102
  - spec/vcr_cassettes/list_spots.yml
103
+ - spec/vcr_cassettes/list_spots_by_radar.yml
103
104
  - spec/vcr_cassettes/list_spots_with_multiple_types.yml
104
105
  - spec/vcr_cassettes/list_spots_with_name.yml
105
106
  - spec/vcr_cassettes/list_spots_with_name_and_types.yml
@@ -145,6 +146,7 @@ test_files:
145
146
  - spec/google_places/spot_spec.rb
146
147
  - spec/spec_helper.rb
147
148
  - spec/vcr_cassettes/list_spots.yml
149
+ - spec/vcr_cassettes/list_spots_by_radar.yml
148
150
  - spec/vcr_cassettes/list_spots_with_multiple_types.yml
149
151
  - spec/vcr_cassettes/list_spots_with_name.yml
150
152
  - spec/vcr_cassettes/list_spots_with_name_and_types.yml