class Lita::Handlers::OnewheelGoogle
Public Instance Methods
search(response)
click to toggle source
# File lib/lita/handlers/onewheel_google.rb, line 13 def search(response) query = response.matches[0][0] result = ::OnewheelGoogle::search(query, config.custom_search_engine_id, config.google_api_key, config.safe_search) reply = "#{result['items'][0]['link']} #{result['items'][0]['title']}: #{result['items'][0]['snippet']}".sub(/\n/, ' ')[0..500] response.reply reply end