michael-maltsev / cheese-fork

A scheduling helper web application for Technion students
https://cheesefork.cf
GNU General Public License v3.0
50 stars 13 forks source link

Feature Request: ICS Subscription per Semester #11

Closed doronbehar closed 4 years ago

doronbehar commented 4 years ago

The ICS download feature is awesome. However, if I make changes in my timetable, I need to delete all of the events from my calendar (which is not that bad since they are repeating events so it's essentially tedious as deleting all events of 1 week) and re-import a new ICS file.

It would have been even better if my user had an ICS url for every semester and I'd subscribe to this ICS feeds and manage them solely through the web interface when I'm signed in.

michael-maltsev commented 4 years ago

It was suggested before, and I considered it. Unfortunately, it turned out to be a bit more complicated than I thought, so I gave up on the functionality for now. I might get back to it one day, but regardless, I can give you a couple of tips that might improve your experience even without the help of CheeseFork:

Note that the downside of using a URL (either your own or one CheeseFork provides, if it had this feature) is that it takes about 12-24 hours for Google Calendar to update the calendar from the URL.

Now, a bit about the technical details of implementing the feature in CheeseFork: currently, when you download the ICS file on CheeseFork, the browser gets your schedule from the calendar that you see and generates the ICS file. All of it is done offline, and you can even do that without being connected to the internet. Now, for providing a calendar URL I have two options:

Ideally, it would be great if Google Calendar would have an intuitive UI for these operations. At least importing is easy on mobile, but it would be great if it had options such as "import ICS to a new calendar" or "delete all events and then import ICS". Perhaps there's a mobile app that can do all that, but I'm not familiar with any.

doronbehar commented 4 years ago

You can easily avoid deleting the events one by one by creating a dedicated calendar for your semester, and importing the ICS file into it. Google for creating a new calendar for more details, there are plenty of tutorials. Then, if you want to replace it, just remove the whole calendar and create a new one.

I was considering that. However, since I don't use Google calendar but DavX5 along with a paid caldav provider, I will need to 'rediscover' the new calendar since it'll have a new UID. This does improve the experience but it has some other small inconveniences. I will consider it in the meantime though.

You can use a URL of your own. For example, you can create a dedicated GitHub repository for your schedule, and upload the ICS file into it. Then, you can grab the raw file URL, and use it on Google Calendar. All you have to do to update the calendar in this case is to upload the new ICS file to the repository, which can be easily done with GitHub web's drag'n'drop interface (or a git client if you prefer).

Now that sounds like a better workaround - I can save that ICS file to a network directory and point my ICS subscriber to a URL pointing to that file. Or alternativly, use an inotify based script to update it in a Git repo or something alike.. However, again. this is not ideal for non techy users..

Note that the downside of using a URL (either your own or one CheeseFork provides, if it had this feature) is that it takes about 12-24 hours for Google Calendar to update the calendar from the URL.

Again, not everybody use Google Calendar, my ICS subscriber app can be configured to sync my calendars every any amount of time I wish.

Have all of the browser logic on a server. This server will need access to the up-to-date course details (updated daily), and at least some of the logic will have to be re-written, since I can't just open a browser on the server. Possible to implement, but not a couple-of-hours work, and of course this server will have to be maintained.

I see. Just out of curiosity, what is the deployment architecture of cheesefork.cf? It seems it's not a completely static site since there is an account (if there's an account there are account data) sitting on some server right?

Have the browser generate and save the up-to-date ICS file from time to time. In this case I need to decide how often to save the ICS file - it needs to be up-to-date, but on the other hand, it's a waste to generate and upload such a file on every click. Also, I'd have to host this file for every student. Possible, but I'm not sure that it's worth the traffic and the storage, and let's not forget the development time.

I noticed cheesefork can notify me of changes made by the institute (which is super cool BTW!). Again, just out of curiosity, does it check for changes only when I'm trying to access my time table?

michael-maltsev commented 4 years ago

Just out of curiosity, what is the deployment architecture of cheesefork.cf? It seems it's not a completely static site since there is an account (if there's an account there are account data) sitting on some server right?

It's a static web application which integrates with Firebase for authentication and database API.

I noticed cheesefork can notify me of changes made by the institute (which is super cool BTW!). Again, just out of curiosity, does it check for changes only when I'm trying to access my time table?

Yes. A copy of your courses' data is saved in the Firebase database when you add courses. The up-to-date data is loaded when you visit CheeseFork, and is compared to your saved copy. If there's any difference, you get a notification.

Have the browser generate and save the up-to-date ICS file from time to time

I'm considering taking this approach, but making the "save changes to remote ICS" action explicit. This will simplify things for me, and should be good enough for users. I'll look at it when I have some spare time.

doronbehar commented 4 years ago

I'm considering taking this approach, but making the "save changes to remote ICS" action explicit. This will simplify things for me, and should be good enough for users.

Firebase could also be abused for this right? I mean - add a separate button that will save the ICS file to Firebase' API while allowing any HTTP client to access it, using a unique link.

michael-maltsev commented 4 years ago

Yes, that's what I had in mind.

michael-maltsev commented 4 years ago

Done! Click on the export button to see it in action.

doronbehar commented 4 years ago

עובד! איזה תותח! תודה רבה :)