Skip to content

Commit

Permalink
Update scraper.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
BfB-Schenefeld committed Apr 21, 2024
1 parent 519d4d8 commit 25d4c14
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scraper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ def scrape_calendar_data(year, month)
link_full_url = link ? "https://www.sitzungsdienst-schenefeld.de/bi/#{link}" : nil

if date_raw && time && meeting && location
# Adjust date to include leading zero
date_parts = date_raw.scan(/\D*(\d+)$/).flatten.first
date = date_parts ? date_raw.sub(/\d+$/, date_parts.rjust(2, '0')) : date_raw
# Extract and format the date
day_part = date_raw[/\D+/] # Extract non-digit characters
date_part = date_raw[/\d+/] # Extract digit characters
date = "#{day_part}#{date_part.rjust(2, '0')}" # Combine and ensure two digits for date

puts "Date: #{date}, Time: #{time}, Meeting: #{meeting}, Location: #{location}, URL: #{link_full_url}"
end
Expand All @@ -51,4 +52,3 @@ def scrape_calendar_data(year, month)
# Example: Scrape data for April 2024
scrape_calendar_data(2024, 4)


0 comments on commit 25d4c14

Please sign in to comment.