Skip to content

Commit

Permalink
donpdonp master haxxor fixxors^2
Browse files Browse the repository at this point in the history
  • Loading branch information
onewheelskyward committed Oct 11, 2018
1 parent 8436f9e commit a2e4782
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/lita/handlers/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ def geo_lookup(user, query, persist = true)
if query[/^http/] or (!geocoded.nil? and geocoded.key? 'geo') # For now this is aaronpk's loc
Lita.logger.debug "Getting location from #{query}"
resp = JSON.parse(RestClient.get query)

locality = ''
if resp['geo']
locality = resp['geo']['locality']
end

loc = Location.new(
resp['geo']['locality'],
locality,
resp['location']['latitude'],
resp['location']['longitude']
)
Expand Down

0 comments on commit a2e4782

Please sign in to comment.