sipb / hydrant

MIT semester course planning app
https://hydrant.mit.edu/
MIT License
27 stars 18 forks source link

add google calendar export back #8

Open cjquines opened 1 year ago

cjquines commented 1 year ago

this is tricky. we can't do google calendar export directly on scripts, because we can't sign up for the google api on the mit domain. i'm not sure what the best solution to this is.

one thought i had was that someone can set up an external service, on their own domain, that takes calendar info from an html querystring, generates the google calendar, then exports it. that way the export to google calendar button can link to that external service. that's a bigger project, but it doesn't need google access on the mit domain.

dolphingarlic commented 1 year ago

What if the website instead generates some .ics file and the user has to add it themselves

cjquines commented 1 year ago

u know how bad people are at following instructions

gabrc52 commented 1 year ago

https://webapps.stackexchange.com/a/47153 You can email them an ICS file to their Gmail, perhaps

I remember there existing a URL that you could use to import ical things.

Maaybe it's this one: https://calendar.google.com/calendar/render?cid= [ics url]

I keep trying to find it, maybe it's somewhere in that stackexchange

cjquines commented 1 year ago

not sure if the ics url is going to work, because it's subscribing to a webcal, which means that it'll get polled ever so often? i'm not sure what'll happen if you try to generate a temporary link and then pull it down later, but we can test that. it also seems to have a length limit if we wanted to try encoding in the url or anything fancy like that.

emailing sounds like it's a lot better, actually. @gabrc52 , you've set up emailing through scripts before, right? how is it done

cjquines commented 1 year ago

it also looks like we can add individual events by generating a url, but not whole calendars: https://github.com/InteractionDesignFoundation/add-event-to-calendar-docs/blob/main/services/google.md

AnhadSawhney commented 1 year ago

Can you add a way to export the ics? While gcal export is broken it would be nice to at least have some way of getting it in my gcal for the spring semester.

Li357 commented 1 year ago

one thought i had was that someone can set up an external service, on their own domain, that takes calendar info from an html querystring, generates the google calendar, then exports it

i'm down to work on this. maybe sending over a compact representation of gapi events objects? one concern is general url limit

gabrc52 commented 1 year ago

You can do a POST request instead of a GET request so there's no maximum length to worry about

Li357 commented 1 year ago

but iirc this external service has to present a pop up to the user to login to their google account, so they have to be navigated to this external page, i.e. clicking a link with querystring. if you do a post request to the external service, it can't present the popup for user action

AnhadSawhney commented 1 year ago

Given that the spring semester is in two days 😳 is it possible to quickly enable ics export for now while gcal support gets developed later? I would really like to not have to add my classes manually 👉👈

Li357 commented 1 year ago

I think #22 should be good to go soon

cjquines commented 1 year ago

closed by #22

cjquines commented 1 year ago

wait i lied