Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ics.acmcsuf.com #912

Closed
wants to merge 2 commits into from

Conversation

diamondburned
Copy link
Collaborator

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
Copy link

netlify bot commented Sep 18, 2023

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
Copy link
Collaborator Author

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.

No idea how anyone used this without installing an LSP before.
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.
Copy link
Owner

@EthanThatOneKid EthanThatOneKid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I'll look into this soon. This seems to be a reimagining of the ICS parser src/lib/server/events/ical.ts we maintained before switching to Google Calendar.

Relevant PR: #696

@diamondburned
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

@EthanThatOneKid
Copy link
Owner

EthanThatOneKid commented Nov 29, 2023

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
Copy link
Collaborator Author

it did not seem to be ready/working.

What was the error?

@EthanThatOneKid
Copy link
Owner

EthanThatOneKid commented Nov 29, 2023

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
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants