EthanThatOneKid / acmcsuf.com

🐘 Official website of CSUF's ACM chapter
https://acmcsuf.com
MIT License
38 stars 46 forks source link

Add support for ics.acmcsuf.com #912

Closed diamondburned closed 9 months ago

diamondburned commented 11 months ago

This commit adds support for parsing ICS calendars using the ICal standard format in addition to the existing Google Calendar API.

The new commit also contains a hard-coded array of ICS calendar links, currently only containing ics.acmcsuf.com. In the future, more links may be added to this.

A hard-coded array was chosen over an environment variable because environment variables cannot express arrays as easily. That said, if there are any private calendars, then they can be used as such:

const KnownCalendars = [
  "public1.ics",
  "public2.ics",
  SECRET_ICS_X,
  SECRET_ICS_Y,
]

In the future, if ics.acmcsuf.com is proven to work well enough, the Google Calendar API could even be completely phased out.

NOTE: It is worth pointing out that this ICS code currently does not support recurring events. This is because ics.acmcsuf.com doesn't do recurring events.

netlify[bot] commented 11 months ago

Deploy Preview for acmcsuf ready!

Name Link
Latest commit
Latest deploy log https://app.netlify.com/sites/acmcsuf/deploys/652d6f3e3286ce3cb7f2b711
Deploy Preview https://deploy-preview-912--acmcsuf.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

diamondburned commented 11 months ago

This PR also adds typescript-language-server as a devDependency. If you don't want this, feel free to cherry-pick the commit out and consider this PR manually merged.

diamondburned commented 11 months ago

Yes. #646 shouldn't really happen since we have the cache, but also ics.acmcsuf.com is much faster than Google Calendar at serving ICS and also does internal caching for this.

diamondburned commented 9 months ago

Closing this PR, since the team doesn't seem to be interested in merging/reviewing it.

EthanThatOneKid commented 9 months ago

Closing this PR, since the team doesn't seem to be interested in merging/reviewing it.

Apologies for not getting around to posting an official review on this PR. I recall testing this PR locally a while ago and it did not seem to be ready/working.

cc @diamondburned

diamondburned commented 9 months ago

it did not seem to be ready/working.

What was the error?

EthanThatOneKid commented 9 months ago

What was the error?

@diamondburned, I don’t recall if there was an error. I actually remember noticing no events were showing despite having events on Discord. I also DM’d you on Discord about this in mid-October.

diamondburned commented 9 months ago

You should give it a try again. I think the bot might've left the server randomly, but it's back now.

I don't remember you replying to me after sending my messages about it.