Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make schedule available as iCalendar-download #21

Open
myabc opened this issue Apr 26, 2013 · 1 comment
Open

Make schedule available as iCalendar-download #21

myabc opened this issue Apr 26, 2013 · 1 comment
Labels

Comments

@myabc
Copy link
Member

myabc commented Apr 26, 2013

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
Copy link
Member Author

myabc commented Apr 26, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant