eurucamp / 2013.jrubyconf.eu

2013.jrubyconf.eu
0 stars 0 forks source link

Make schedule available as iCalendar-download #21

Open myabc opened 11 years ago

myabc commented 11 years ago

An idea I discussed with @pietia – we enter schedule information into Lanyrd first, parse their .iCal files into our own Yaml format and display from there.

myabc commented 11 years ago

POC

# encoding: UTF-8
require 'bundler/setup'
require 'icalendar'

Encoding::default_external = Encoding::UTF_8

# Open a file or pass a string to the parser
cal_file = File.open("schedule.ics")

# Parser returns an array of calendars because a single file
# can have multiple calendars.
cals = Icalendar.parse cal_file
cal = cals.first

cal.events.each do |e|
  puts "- " << e.summary
  puts e.description
end