lib/Zeta/plugins/weather.rb in zetabot-1.0.4 vs lib/Zeta/plugins/weather.rb in zetabot-1.0.5
- old
+ new
@@ -100,11 +100,11 @@
if stored
lat, lon = @store[msg.user.to_s].split(',')
else
ac = JSON.parse(
- open(URI.encode("http://maps.googleapis.com/maps/api/geocode/json?address=#{location}")).read,
+ open(URI.encode("http://maps.googleapis.com/maps/api/geocode/json?address=#{location}&key=#{Config.secrets[:google]}")).read,
object_class: OpenStruct
)
return nil if ac.results.nil?
if ac.status = "OVER_QUERY_LIMIT"
return msg.reply("Google API - Over query Limit")
@@ -153,11 +153,11 @@
if stored
lat, lon = @store[msg.user.to_s].split(',')
else
ac = JSON.parse(
- open(URI.encode("http://maps.googleapis.com/maps/api/geocode/json?address=#{location}")).read,
+ open(URI.encode("http://maps.googleapis.com/maps/api/geocode/json?address=#{location}&key=#{Config.secrets[:google]}")).read,
object_class: OpenStruct
)
return nil if ac.results.nil? ## Unable to locate
if ac.status = "OVER_QUERY_LIMIT"
@@ -199,11 +199,11 @@
# DarkSky - https://darksky.net/dev
def darksky_src(msg,location,stored=false)
ac = JSON.parse(
- open(URI.encode("http://maps.googleapis.com/maps/api/geocode/json?address=#{location}")).read,
+ open(URI.encode("http://maps.googleapis.com/maps/api/geocode/json?address=#{location}&key=#{Config.secrets[:google]}")).read,
object_class: OpenStruct
)
return nil if ac.results.nil? ## Unable to locate
if ac.status = "OVER_QUERY_LIMIT"
@@ -260,10 +260,10 @@
if stored
lat, lon = @store[msg.user.to_s].split(',')
else
ac = JSON.parse(
- open(URI.encode("http://maps.googleapis.com/maps/api/geocode/json?address=#{location}")).read,
+ open(URI.encode("http://maps.googleapis.com/maps/api/geocode/json?address=#{location}&key=#{Config.secrets[:google]}")).read,
object_class: OpenStruct
)
return nil if ac.results.nil? ## Unable to locate
if ac.status = "OVER_QUERY_LIMIT"