recalapp / recal

First a COS 333 project, now a very popular tool at Princeton for course selection
http://recal.io
MIT License
12 stars 3 forks source link

Calendar export to GCal (including bump to Django 1.8) #309

Closed maximz closed 8 years ago

maximz commented 7 years ago

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.”“

image

image

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: