Method: UI.randQ
- Defined in:
- lib/ruby_doc/cli/ui.rb
.randQ ⇒ Object
Quotes=====================
410 411 412 413 414 415 416 417 418 |
# File 'lib/ruby_doc/cli/ui.rb', line 410 def self.randQ puts sepB html = Nokogiri::HTML(open("https://fortrabbit.github.io/quotes/")) container = html.search(".row.gutter-l.wrap") quotes = container.search("p").map {|quote| quote.text.gsub(/[\n]\s+/, "")} quote = " "+ quotes[rand(0..180)]+ " " wrapped(quote, 55).black end |