17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/okbot/cli.rb', line 17
def blitz
puts "Please choice your theater!"
puts "1. pvj"
puts "----------"
puts "2. miko"
puts "----------"
puts "3. bec"
puts "----------"
answer = STDIN.gets.chomp
print "Doing your schedule..."
spin_it{
sleep rand(4)+2
}
print "done!"
case answer
when "1", "pvj"
doc = Nokogiri::XML(open("https://www.cgvblitz.com/en/schedule/cinema/0100"))
puts Rainbow("Result schedule PVJ MALL").yellow
puts "--------------------"
doc.css('.schedule-title').children.each do |l|
puts l.content.color(:cyan)
end
puts "--------------------"
when "2", "miko"
doc = Nokogiri::HTML(open("https://www.cgvblitz.com/en/schedule/cinema/1200"))
puts Rainbow("Result schedule MIKO MALL").yellow
puts "--------------------"
doc.css('.schedule-title').children.each do |l|
puts l.content.color(:cyan)
end
puts "--------------------"
when "3", "bec"
doc = Nokogiri::HTML(open("https://www.cgvblitz.com/en/schedule/cinema/1400"))
puts Rainbow("Result schedule BEC MALL").yellow
puts "--------------------"
doc.css('.schedule-title').children.each do |l|
puts l.content.color(:cyan)
end
puts "--------------------"
else
puts "Please check you choice!"
end
end
|