Class: CliMagic

Inherits:
Object
  • Object
show all
Defined in:
lib/climagic.rb

Overview

The main climagic driver

Class Method Summary collapse

Class Method Details

.cmdObject

Get command of the day from climagic

Example:

>> CliMagic.cmd()
=> "while true; do date; printf "\033[A"; sleep 1; done"


12
13
14
15
16
17
18
# File 'lib/climagic.rb', line 12

def self.cmd()
    # Gets the command of the day 
    cmd_url = 'http://www.climagic.org/'
    cmd_selector = "tt" # Hope this remians ;) 
    page = Nokogiri::HTML(open(cmd_url).read)
    page.css(cmd_selector).text
end