caboose-rets 0.1.195 → 0.1.197

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: 9c32977a4700cd7eb4bf3705dda1ccfdcc755ede9b9856844264258e5a81a703
4
- data.tar.gz: 3348335c0ad5ebc589830854bc6030215b7825effc32343a2362669923f4ae5b
3
+ metadata.gz: 7ae9127c4ea1ed4c63d14cbd9276194add06de8cef432c5c7e239e09b34a51ba
4
+ data.tar.gz: 889cccc0b40b15ba30301c00ae0722b917d7f68066a9d356f5b87469fac78814
5
5
  SHA512:
6
- metadata.gz: 34f40bba01f5fa570db421b465313b7386d4acab24ff69cd3ec8bfa8e8780f2cc2efb956c0d5131facd1362815c2bf513c7b886d580e4681f2358d9e91254ae1
7
- data.tar.gz: dfe6230980c21660282605f3612aa3e21899dc2dc95d39f9a982cca2644b42faee4df5f8e8333c97b2ac504504c541bfd0bfc50d89ac464bf20388ccae4ee7b5
6
+ metadata.gz: 6a51961c562377fad60b8ae261aa63bbdab298f13698af76690860c9b3feef74a050389f40d0369287de1c7f0a332e77d42a8dc1f687b0bb4081573bdc41775f
7
+ data.tar.gz: d3be76e4aa57f9bbbede583ab8546070b918479ba402982ecf7c9844a614a721d5769afb89345c6de0534ea1682d247c20d25fe309a0d1589b314072f9f0ae7e
@@ -448,13 +448,15 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
448
448
 
449
449
  def self.coords_from_address(address)
450
450
  begin
451
- uri = "https://maps.googleapis.com/maps/api/geocode/json?key=AIzaSyB9Wwx7sdWaUnFyLcdQ61NOV7DE2NZkDUE&address=#{address}"
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.log "Error: #{uri}"
459
+ self.log3("Property",nil,"Error with Geocoder API, url: #{uri}")
458
460
  sleep(2)
459
461
  return false
460
462
  end
@@ -236,7 +236,7 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
236
236
  self.log3('Agent',mls_id,"Skipping importing Agent #{mls_id} because last_updated is today...")
237
237
  end
238
238
  end
239
- end
239
+ end
240
240
 
241
241
  def self.import_open_house(oh_id, save_images = true)
242
242
  self.log3('OpenHouse',oh_id,"Importing Open House #{oh_id}...")
@@ -367,7 +367,7 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
367
367
 
368
368
  def self.coords_from_address(address)
369
369
  begin
370
- uri = "https://maps.googleapis.com/maps/api/geocode/json?key=AIzaSyB9Wwx7sdWaUnFyLcdQ61NOV7DE2NZkDUE&address=#{address}"
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)
@@ -1,3 +1,3 @@
1
1
  module CabooseRets
2
- VERSION = '0.1.195'
2
+ VERSION = '0.1.197'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-rets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.195
4
+ version: 0.1.197
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry