For posterity, here is the calendar export feature specing discussion:
Modeled off TripIt’s subscription feed for Google Calendar.
Backend
Exporting read-only iCal feed from each schedule. This means a cached API call that returns ical format instead of json, with all class meetings for current semester.
We want to preserve privacy, meaning we cannot use simple integer schedule IDs — otherwise you just simply toss in another ID and you have someone else’s calendar (though you don’t know whose). Or if someone’s integer ID gets compromised, they can’t do anything about it. Instead, have a mapping from schedule ID to guids for this publishing part only. The random guid is generated when a new schedule is created (or when ical feed is first requested?), and the user can opt to get a new feed url by clicking a button in the dialog box.
Prototype: I have a python script written that generates ical with recurring events and all that.
You can add it to your google calendar with this url: https://www.maximzaslavsky.com/recal_ical/test2.ics
It has a TTL of 15 minutes, so google should refresh it every 15 mins (would like to test this)
The action bar will include a button called “Export to Google Calendar” or “Subscribe in Google Calendar”. This launches a modal window with a short description of the feature:
“You can subscribe to your ReCal schedule from Google Calendar for an always up-to-date copy of your schedule on your mobile device or laptop.”
Then we show the ical feed URL in a little box that doesn’t let you select individual letters but only select the whole URL. Perhaps with a “Copy” button next to it.
Then we explain how to connect with Google Calendar:
“Copy this URL. Then go to Google Calendar [linked] and click the arrow button next to “Other calendars” on the left-hand side. Paste the URL into the box that pops up, and hit “Add Calendar.”“
Then we say “Keep your URL private! It allows anyone to see your schedule. Need a new URL?”
That last bit — “need a new url” — calls to the server to get a new guid, then replaces the displayed feed URL, and shows a little message saying “New feed URL created.”
Questions:
how to make ical format? do we need many individual events, or repeating events?
what happens if recal goes down? does google calendar erase?
how often does google calendar sync?
can we force a sync?
are there any situations where events would be duplicated?
is there a way to automate adding ical feed to google calendar?
what happens if user makes a change in their local cal? is this even possible?
For posterity, here is the calendar export feature specing discussion:
Modeled off TripIt’s subscription feed for Google Calendar.
Backend
Exporting read-only iCal feed from each schedule. This means a cached API call that returns ical format instead of json, with all class meetings for current semester.
We want to preserve privacy, meaning we cannot use simple integer schedule IDs — otherwise you just simply toss in another ID and you have someone else’s calendar (though you don’t know whose). Or if someone’s integer ID gets compromised, they can’t do anything about it. Instead, have a mapping from schedule ID to guids for this publishing part only. The random guid is generated when a new schedule is created (or when ical feed is first requested?), and the user can opt to get a new feed url by clicking a button in the dialog box.
Prototype: I have a python script written that generates ical with recurring events and all that. You can add it to your google calendar with this url: https://www.maximzaslavsky.com/recal_ical/test2.ics It has a TTL of 15 minutes, so google should refresh it every 15 mins (would like to test this)
Python: https://gist.github.com/maximz/975273b907bbdae5763d
Running an experiment overnight. Collecting logs in a docker container: https://gist.github.com/maximz/a6fdf6ba750b4aeb33c5
Frontend
The action bar will include a button called “Export to Google Calendar” or “Subscribe in Google Calendar”. This launches a modal window with a short description of the feature: “You can subscribe to your ReCal schedule from Google Calendar for an always up-to-date copy of your schedule on your mobile device or laptop.”
Then we show the ical feed URL in a little box that doesn’t let you select individual letters but only select the whole URL. Perhaps with a “Copy” button next to it.
Then we explain how to connect with Google Calendar: “Copy this URL. Then go to Google Calendar [linked] and click the arrow button next to “Other calendars” on the left-hand side. Paste the URL into the box that pops up, and hit “Add Calendar.”“
Then we say “Keep your URL private! It allows anyone to see your schedule. Need a new URL?” That last bit — “need a new url” — calls to the server to get a new guid, then replaces the displayed feed URL, and shows a little message saying “New feed URL created.”
Questions: