class Lita::Handlers::Awyiss
Public Instance Methods
duck(response)
click to toggle source
# File lib/lita/handlers/awyiss.rb, line 13 def duck(response) uri = URI('http://awyisser.com/api/generator') post = Net::HTTP.post_form(uri, 'phrase' => response.matches.flatten[0]) link = JSON.parse(post.body).fetch('link') response.reply(link) end