Proof-of-concept rendering ical (ics) files with simple_calendar
and Ruby on
Rails 6 using Ruby 3.
Just the very basic attributes like start and end-date and title are used. Fancy features like schedules are ignored.
Configure event sources:
# prefix with RAILS_ENV=production as needed
rails r 'EventSource.create!(name: "MyEventSource", location: "https://myseminardeskurl", kind: "seminardesk")'
rails r 'EventSource.create!(name: "MyLocalICSFile", location: "/tmp/myfile.ics", kind: "local_ics_file")'
Alternatively, use the rails sevencal:add_ics_file
or rails sevencal:add_seminardesk_api_url
to interactively add Event Sources.
Currently, two kind
s of EventSources are implemented:
seminardesk
to fetch from a proprietary APIlocal_ics_file
to read and parse a local ics file
None yet.
Use a rails
rake task:
rails sevencal:sync
that will sync all data (refresh all EventSource
s).
This task is suitable for a cron-job.
Note that this will throw away all previously stored events and only add future events.
Note that there is no error handling yet.
Nothing fancy.
For the POC the syncing scenario is as following:
A nextcloud instance downloads local caldav file and copies it to the server. The server converts the seminardesk data and writes it to file. The nextcloud instance downloads the remote seminardesk ics file.
Contributions are welcome, drop me a line / open an issue.
Licensed under the AGPLv3+, copyright 2021 Felix Wolfsteller.
- Instead of comparing everything during every sync step, a cheap solution is to throw everything (all events) away before importing.
- Copied the view over to add week number column.