Advertisement
dak1n1

Ruby ical parsing example

Sep 12th, 2013
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.33 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2. require "rubygems"
  3. require "ri_cal"
  4.  
  5. File.open("mycalendar.ics", "r") do |file|
  6.     calendar = RiCal.parse(file)
  7.  
  8.     calendar.each do |cal|
  9.         cal.events.each do |event|
  10.            puts "Event occurs from: #{event.dtstart} to #{event.dtend}"
  11.            puts "#{event.summary}"
  12.         end
  13.     end
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement