class Lita::Handlers::OnewheelOpenweathermap
Public Instance Methods
get_data()
click to toggle source
# File lib/lita/handlers/onewheel_openweathermap.rb, line 16 def get_data uri = "http://api.openweathermap.org/v3/uvi/45.75,-122.75/#{Date.today.iso8601 + "Z"}.json?appid=#{config.api_key}" puts "getting #{uri}" data = RestClient.get uri JSON.parse data end
uv_index(response)
click to toggle source
# File lib/lita/handlers/onewheel_openweathermap.rb, line 10 def uv_index(response) data = get_data response.reply "UV index in Portland, OR is #{data['data']} today." end