aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2018-10-01 20:04:19 +0200
committerHarald Eilertsen <haraldei@anduin.net>2018-10-01 20:04:19 +0200
commita08e55b7dee696aa403a75d67e06728fee2f427c (patch)
tree01873dd779433f2f82d3cd410f479597e56501dd
parent1ff11e975cf2d5a07f4d1c4f5b9f84b8e74c6e4f (diff)
downloadramaskrik-program-a08e55b7dee696aa403a75d67e06728fee2f427c.tar.gz
ramaskrik-program-a08e55b7dee696aa403a75d67e06728fee2f427c.tar.bz2
ramaskrik-program-a08e55b7dee696aa403a75d67e06728fee2f427c.zip
Replace tabs, whitespace only.
-rw-r--r--ramaskrik-program.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/ramaskrik-program.rb b/ramaskrik-program.rb
index c485fce..c2ba006 100644
--- a/ramaskrik-program.rb
+++ b/ramaskrik-program.rb
@@ -21,20 +21,20 @@ require 'room-schedule'
require 'uri'
class Movie
- attr_reader :title, :link, :start_time, :end_time, :venue
+ attr_reader :title, :link, :start_time, :end_time, :venue
- def initialize(node)
- @title = node.css("h4").text.strip
+ def initialize(node)
+ @title = node.css("h4").text.strip
@link = URI.join("https://ramaskrik.no", node.css("h4 a").attribute('href').value)
- @start_time = DateTime.parse(node.css(".date").attribute('title').value)
- @end_time = DateTime.parse(@start_time.strftime('%F') + node.css(".prgtype-endTime").text.strip.sub(/\w+/, ''))
- @end_time += 1 if @end_time < @start_time
- @venue = node.css(".place").text.strip
- end
-
- def to_s
- "#{title} #{start_time} - #{end_time}, #{venue}"
- end
+ @start_time = DateTime.parse(node.css(".date").attribute('title').value)
+ @end_time = DateTime.parse(@start_time.strftime('%F') + node.css(".prgtype-endTime").text.strip.sub(/\w+/, ''))
+ @end_time += 1 if @end_time < @start_time
+ @venue = node.css(".place").text.strip
+ end
+
+ def to_s
+ "#{title} #{start_time} - #{end_time}, #{venue}"
+ end
end
doc = Nokogiri::HTML(open("https://ramaskrik.no/program/"))