module INAW

Constants

VERSION

Public Class Methods

word(lang) click to toggle source
# File lib/inaw.rb, line 10
def self.word(lang)
    lang = lang.upcase
    if @languages.include? lang
        url = 'https://www.palabrasaleatorias.com/' + @languages[lang]
        uri = URI.parse(url)
        html = Net::HTTP.get_response(uri)
        response = Nokogiri::HTML(html.body)
        description = response.css("div")[1].text.strip
    else
        puts '[INAW] This language is not supported.'
    end
end