caboose-rets 0.1.196 → 0.1.198
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7031da9a57011b4874427b3a075e8fae1ca69eb7891b11bbbaa86355cc8f6b6
|
4
|
+
data.tar.gz: 458bc2ef48b75e7c9818195a486696281ef6b0d24b4ddb52c320f5ba4f37cd82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 598980b63007e7f7c53201ba3fd124adbe4c809a5a6485bae521cb0d291d88d4bbed771b295a23321217f8fd8ab46d38cb2508826cf4838d11a154cbb028e11b
|
7
|
+
data.tar.gz: 75a0ddee7d87b554dc65743c73694756a6a78d2304880549bc27ac6e4fa0161c09c41b96ad4e41e009eb56e1f33b426ea8de490e62b334ac911e89e91c7ffa5b
|
@@ -448,13 +448,15 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
|
|
448
448
|
|
449
449
|
def self.coords_from_address(address)
|
450
450
|
begin
|
451
|
-
|
451
|
+
config = YAML::load(File.open("#{Rails.root}/config/rets_importer.yml"))
|
452
|
+
api_key = config[Rails.env]['google_api_key']
|
453
|
+
uri = "https://maps.googleapis.com/maps/api/geocode/json?key=#{api_key}&address=#{address}"
|
452
454
|
uri.gsub!(" ", "+")
|
453
455
|
resp = HTTParty.get(uri)
|
454
456
|
json = JSON.parse(resp.body)
|
455
457
|
return json['results'][0]['geometry']['location']
|
456
458
|
rescue
|
457
|
-
self.
|
459
|
+
self.log3("Property",nil,"Error with Geocoder API, url: #{uri}")
|
458
460
|
sleep(2)
|
459
461
|
return false
|
460
462
|
end
|
@@ -362,12 +362,12 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
|
|
362
362
|
|
363
363
|
p.latitude = coords['lat'].to_f
|
364
364
|
p.longitude = coords['lng'].to_f
|
365
|
-
p.save
|
365
|
+
p.save
|
366
366
|
end
|
367
367
|
|
368
368
|
def self.coords_from_address(address)
|
369
369
|
begin
|
370
|
-
uri = "https://maps.googleapis.com/maps/api/geocode/json?key=
|
370
|
+
uri = "https://maps.googleapis.com/maps/api/geocode/json?key=12345&address=#{address}"
|
371
371
|
uri.gsub!(" ", "+")
|
372
372
|
resp = HTTParty.get(uri)
|
373
373
|
json = JSON.parse(resp.body)
|
data/lib/caboose_rets/version.rb
CHANGED