-
Notifications
You must be signed in to change notification settings - Fork 89
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
Conversation
c5251fc
to
2e06c04
Compare
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 |
@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. |
server/api/events.js
Outdated
@@ -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 ({ |
There was a problem hiding this comment.
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/
?
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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.
@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. |
@arashsheyda 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. |
@dgmouris Ahhh I see, thanks for investigating this! haha that sounds good! |
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. |
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?
Does the following command run without warnings or errors?
npm run pr-checks
Have you taken a look at our contributing guidelines?
My node version matches the one suggested when running
nvm use
?