class Descartes::Dicteng

Public Instance Methods

execute(m, action, word) click to toggle source
# File lib/descartes/modules/dicteng.rb, line 23
def execute(m, action, word)
        url  = "http://www.wordreference.com/#{action}/#{word}"
        page = Nokogiri::HTML open(url)
        m.reply "#{page.xpath('//table[@class="WRD"]/tr[2]').text}  di più qui: #{url}"
end