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

Auto Event importing from Meetup Sources through single server endpoint. #455

Merged
merged 6 commits into from
Jan 30, 2025

Conversation

dgmouris
Copy link
Collaborator

What issue is this referencing?

Essentially importing events has been a bit of pain into this calendar (which was to be expected).

This essentially looks at a variety of ical links and downloads them and uploads them to the gmail calendar.

I like this solution because we can continue to add events directly to the gmail in addition to these ical sources, for example hacked and any eventbrite links read democamp but reduces a lot of logistics in updating the calendar.

#394 Improving the calendar.
#366 (kind of because we might not need it)

Functionality demonstrated in a gif below (it's a little big so I shared it from my drive).
You'll have to download it

I'd like to add this to a cron job so it imports every night, I think we can do this fairly easily with nuxt-cron

Do these code changes work locally and have you tested that they fix the issue yourself?

  • yes!

Does the following command run without warnings or errors?

  • yes! npm run pr-checks

Have you taken a look at our contributing guidelines?

  • yes!

My node version matches the one suggested when running nvm use?

  • yes!

@dgmouris dgmouris force-pushed the events_importer_394 branch from c5251fc to 2e06c04 Compare January 24, 2025 22:44
@dgmouris
Copy link
Collaborator Author

We could schedule this in a few different ways, but essentially it would be a single API hit to https://devedmonton.com/api/import_events which I think it just the easiest overall.

I know that nuxt-cron might not be good for netlify and netlify has scheduled functions I've never used either but maybe someone here has.

@dgmouris dgmouris changed the title DRAFT: Event importing via API link Auto Event importing from Meetup Sources through single server endpoint. Jan 27, 2025
@dgmouris
Copy link
Collaborator Author

@arashsheyda and @MandyMeindersma I figured out comment #441 (comment) based on not being able to import this calendar from the development preview.

Once we merge this in it should be good.

@@ -21,7 +21,7 @@ Reference for folks who maybe curious.
* @param {number} options.limitEvents - The maximum number of events to retrieve.
* @returns {Promise<Array>} An array of events.
*/
const getEvents = async ({
export const getEvents = async ({
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we move the shared functions, constants and etc. to server/utils/?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah that makes sense I'll make this a bit more organized, I think server/utils is a great choice :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I only put the google calendar into its' own utils file here.

I can put the ical functions into its' own file if preferred but this will be the only place that uses them.

The Nitro plug cron job will only hit this URL and then move on.

@arashsheyda
Copy link
Collaborator

@dgmouris Nuxt supports cron jobs internally, maybe we can use that https://nitro.build/guide/tasks

@dgmouris
Copy link
Collaborator Author

@dgmouris Nuxt supports cron jobs internally, maybe we can use that https://nitro.build/guide/tasks

I'll take a look at that shortly so maybe we can ship this with both.

@dgmouris
Copy link
Collaborator Author

dgmouris commented Jan 28, 2025

@dgmouris Nuxt supports cron jobs internally, maybe we can use that https://nitro.build/guide/tasks

@arashsheyda
So I took a bit of a look into this, it looks like the tasks API is experimental which is fine but I don't think that they support Netlify yet...

IMO the better option is to do a scheduled function, but let's move that to another PR if you don't mind.

Until add it I could just hit the API once a day, I think there's already a ton in here, and it would add a lot of value for my own selfish purposes of not having to import events manually.

Let me know what you think, sorry for the essay.

@arashsheyda
Copy link
Collaborator

arashsheyda commented Jan 28, 2025

@dgmouris Ahhh I see, thanks for investigating this! haha that sounds good!
(I've only tried it locally too so this is really good to know, thanks again!)

@dgmouris
Copy link
Collaborator Author

On another note it seems like scheduled functions are also in beta.

I'll probably make a separate pr for that as again not sure if it'll work as intended.

@dgmouris dgmouris merged commit 6d8d394 into devedmonton:main Jan 30, 2025
4 checks passed
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