Created
March 30, 2019 14:20
-
-
Save jurgenwerk/e569ee2b1a3e1b9d580b903953da2de4 to your computer and use it in GitHub Desktop.
Ruby script to check if Boros Sammlung in Berlin has any free space on provided dates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url = "https://www.sammlung-boros.de/visit/fuehrungen-buchen.html?L=1#item_2" | |
date_range = Date.parse("10-05-2019")..Date.parse("13-05-2019") | |
html = open(url) | |
doc = Nokogiri::HTML(html) | |
doc.search(".block_empty").map do |b| | |
[b.parent.parent.parent.search("h1").text.split(",")[1].strip, b.parent.text.chomp.strip] | |
end.select { |r| Date.parse(r[0]).in?(date_range) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment