悪のコード
code:seigadai.rb
require 'net/http'
require 'json'
def notify(datetime)
system %(osascript -e 'display notification "#{datetime}" with title "空き発見!!!!" sound name "Glass"')
end
while true do
dates = %w(20250718 20250719 20250720 20250721 20250723)
dates.each do |date|
url = "#{BASE}#{date}"
response = Net::HTTP.get(URI(url))
data = JSON.parse(response)
puts data
data.each do |slot|
puts "!!!!!! found !!!!!!!!!!"
end
end
sl = rand(1..3)
puts "Sleeping for #{sl} seconds..." sleep(sl)
end
sl = rand(250..400)
puts "Sleeping for #{sl} seconds before next check..." sleep(sl)
end
binding.irb