google-place-text-search 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google_place_text_search.rb +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4c5b6b65cb33006518292691b985941a762c0fc
|
4
|
+
data.tar.gz: cc81164ee9e4f78a5923bec9d98cb3cd668691fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b7816762eeab71f75e305ee84f088cf762c6164850546c2af6461674728bba8e0cf095dbf4229f64f568661b2508019bcd8de20a839613dbb917bd269943654
|
7
|
+
data.tar.gz: a8d5c50dc296211f83ad41add354b5a71c6fa2f3c3aa790ac278d5ef75d451eea6aba39b22ceb5c131efada27219492765de9347243dcbe3f3afe49286b63121
|
@@ -1,14 +1,16 @@
|
|
1
1
|
class GooglePlaceTextSearch
|
2
|
-
|
2
|
+
require 'debugger'
|
3
3
|
require 'httparty'
|
4
4
|
require 'json'
|
5
5
|
|
6
6
|
def get_response(api_key,radius,location,query)
|
7
7
|
url = "https://maps.googleapis.com/maps/api/place/textsearch/json"
|
8
8
|
#location="#{lat},#{lng}"
|
9
|
-
|
9
|
+
|
10
|
+
query_data = {:key=>api_key,:query=>query, :location=>location,:radius=>radius}
|
11
|
+
response = HTTParty.get("#{url}", :query=>query_data)
|
10
12
|
|
11
|
-
|
13
|
+
json = JSON.parse(response.body)
|
12
14
|
return json
|
13
15
|
end
|
14
16
|
|