diff options
-rw-r--r-- | ramaskrik-program.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ramaskrik-program.rb b/ramaskrik-program.rb index 5014260..a9af3a0 100644 --- a/ramaskrik-program.rb +++ b/ramaskrik-program.rb @@ -39,17 +39,20 @@ doc = Nokogiri::HTML(open("program.html")) ## open("https://ramaskrik.no/program movies = doc.css(".kultur-type-movie").map { |movie| Movie.new(movie) } days = movies.group_by { |movie| movie.start_time.strftime("%A %d.%m.%Y") } days.each do |d, movies| + rooms = movies.group_by { |m| m.venue }.delete_if { |t, _| t == "Ramaskrik" } + graph = SVG::Graph::RoomSchedule.new({ graph_title: d, show_graph_title: true, show_x_guidelines: true, width: 1280, + height: rooms.keys.length * 100 + 25, key: false, x_label_format: "%H:%M", timescale_divisions: "30 minutes", }) - movies.group_by { |m| m.venue }.delete_if { |t, _| t == "Ramaskrik" }.each do |title, data| + rooms.each do |title, data| graph.add_data(title: title, data: data) end |