This is a Ruby script that downloads an iCalendar feed and converts it to an org-mode file. This can be useful e.g. to view the events of the calendar on org-agenda
.
It can be used with any URL that points to an .ics file, but has only beed tested with Outlook calendar feeds from Office365. In addition it also irons out some wrinkles of the Office365 feed, like translating Windows time zone identifiers to proper IANA identifiers.
Since a lot of org mode users have very distinct workflows this is not a library yet, but can serve as a starting point to build your own workflow.
- Convert iCalendar events to org entries
- Templating for the org file and the single entries
- Filter rules for events to be converted (e.g. filter by event title or reject all-day events)
- Choose time period for events to convert
- Org file is read-only by default to prevent accidental edits
- Proper implementation to fix all timezones, not just mine ;)
- Figure out how to run the script on a regular basis
In order to use the script, you need to publish your calendar in your Shared calendar settings. You will obtain the secret URL to your .ics file there.
You can read more about it here: Share your calendar in Outlook on the web (section “Publish your calendar”).
You will need to set two variables:
ICAL_TO_ORG_URL
the URL to the iCalendar file as described above.OUTLOOK_TO_ORG_OUTPUT
the path to the output org file (which will be overwritten).
ICAL_TO_ORG_URL=https://outlook.office365.com/owa/calendar/<secret>/calendar.ics OUTLOOK_TO_ORG_OUTPUT=/Users/myuser/org/Cal.org ruby ical_to_org.rb
These are libraries that I used in the past and that also worked well for me.