W
Web5•14mo ago
ALR

Google Calendar Integration

Google Calendar integration stuff - I got is working E2E with the Google account, kinda. 😛
node .
Upcoming 10 events:
2023-10-03T09:00:00-07:00 - Community Leadership Core Huddle
2023-10-03T09:00:00-07:00 - [REDACTED]
2023-10-03T10:00:00-07:00 - [REDACTED]
2023-10-03T10:00:00-07:00 - Community Leadership Huddle - Extra Time
2023-10-03T11:30:00-07:00 - [REDACTED]
2023-10-03T12:00:00-07:00 - Lunch Block
2023-10-03T12:00:00-07:00 - [REDACTED]
2023-10-03T12:30:00-07:00 - TBD Automated Docs Pipeline Public Discussion
2023-10-03T13:00:00-07:00 - [REDACTED]
2023-10-03T14:30:00-07:00 - [REDACTED]
node .
Upcoming 10 events:
2023-10-03T09:00:00-07:00 - Community Leadership Core Huddle
2023-10-03T09:00:00-07:00 - [REDACTED]
2023-10-03T10:00:00-07:00 - [REDACTED]
2023-10-03T10:00:00-07:00 - Community Leadership Huddle - Extra Time
2023-10-03T11:30:00-07:00 - [REDACTED]
2023-10-03T12:00:00-07:00 - Lunch Block
2023-10-03T12:00:00-07:00 - [REDACTED]
2023-10-03T12:30:00-07:00 - TBD Automated Docs Pipeline Public Discussion
2023-10-03T13:00:00-07:00 - [REDACTED]
2023-10-03T14:30:00-07:00 - [REDACTED]
22 Replies
ALR
ALROP•14mo ago
So this is using the OAuth method which is a browser-based flow. That doesn't make sense for our Google Calendar because it has the app acting as a user. The redacted stuff is from my personal calendar, for instance. So what I'm doing next is trying the "API Key" method - created an API key for the public-facing calendar Looking for a QuickStart on actually using that key for AUTH But I'm seeing at least teh Calendar API service is activated and it works Will stay on it
Unknown User
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
ALR
ALROP•14mo ago
It’s just something you use to anonymously read from public-facing events on the Calendar API We want it for making a calendar page on the dev site Showing what’s coming up What’s interesting about that is that we should probably render it server side, and kick off a new build on events change Otherwise it’d be an unbounded bunch of client calls hitting the calendar API
Unknown User
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
ALR
ALROP•14mo ago
TBD - I was hoping the Calendar API would have an event they could fire, and if not, polling for changes sounds icky Haven’t worked through that bit yet - @dayhaysoos-tbd may have in some of his early prototyping The hack is that we don’t monitor for changes at all and just kind of run the API call whenever we build anyway. Like the dev site gets several updates in the course of a week naturally Could be another Phase /)
Unknown User
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
ALR
ALROP•14mo ago
Totally - we could cron job it, even updating once an hour is totally fine Update on Google Calendar - working through various Block processes to get a service account key added; there's a global no-no on it so will either find workaround or file us for an exception. @dayhaysoos-tbd @leordev Google Calendar does indeed have push notifications (we can use for webhooks): https://developers.google.com/calendar/api/guides/push
Unknown User
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
ALR
ALROP•14mo ago
WHO'S THE MAN?
Upcoming 10 events:
2023-10-06T07:30:00-07:00 - Beginner's Guide to Building a Web5 app
2023-10-06T09:00:00-07:00 - Hackfest Fridays: Q&A And PR Reviews
2023-10-06T11:00:00-07:00 - Weekly Delivery - Open Source Programs
2023-10-10T10:30:00-07:00 - Weekly Scoping - Open Source Programs
2023-10-10T11:00:00-07:00 - DWN Office Hours
2023-10-13T09:00:00-07:00 - Hackfest Fridays: Q&A + PR Reviews
2023-10-13T11:00:00-07:00 - Weekly Delivery - Open Source Programs
2023-10-17T10:30:00-07:00 - Weekly Scoping - Open Source Programs
2023-10-17T11:00:00-07:00 - DWN Office Hours
2023-10-20T11:00:00-07:00 - Weekly Delivery - Open Source Program
Upcoming 10 events:
2023-10-06T07:30:00-07:00 - Beginner's Guide to Building a Web5 app
2023-10-06T09:00:00-07:00 - Hackfest Fridays: Q&A And PR Reviews
2023-10-06T11:00:00-07:00 - Weekly Delivery - Open Source Programs
2023-10-10T10:30:00-07:00 - Weekly Scoping - Open Source Programs
2023-10-10T11:00:00-07:00 - DWN Office Hours
2023-10-13T09:00:00-07:00 - Hackfest Fridays: Q&A + PR Reviews
2023-10-13T11:00:00-07:00 - Weekly Delivery - Open Source Programs
2023-10-17T10:30:00-07:00 - Weekly Scoping - Open Source Programs
2023-10-17T11:00:00-07:00 - DWN Office Hours
2023-10-20T11:00:00-07:00 - Weekly Delivery - Open Source Program
I don't even know how to use this broken horrible excuse for a programming language and there aren't even Node APIs documented for this thing. I'm a deity. OK I have a proposal for how to design this Calendar feature into our system: 1) Now that we're standing up server infra, we make a new service - the Calendar Service. That service is an indirection. 2) This thing runs like every 5 minutes, and hits the Google Calendar API 3) It caches the result of those queries and stores them as JSON. 4) When visitors to developer.tbd.website come to the calendar page, client side that thing hits our Calendar Service. 5) It gets the JSON from our service and renders it That way we don't have to worry about managing events in the past, events getting stale, setting up webhooks, etc. The dev site always stays up-to-date with events within a 5 minute window and clients hit our service directly, running on Block infra just as we do for the Feedback Widget. WDYT?
Unknown User
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
ALR
ALROP•14mo ago
Let's talk tomorrow 😄 Shame on me for leaving messages assuming y'all'd wait until working hours 🙂
Unknown User
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
ALR
ALROP•14mo ago
So @leordev how does SEO factor into this feature? From the perspective of an indexing bot they’d just be hitting developer.tbd.website
Unknown User
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
ALR
ALROP•14mo ago
This is a great call-out. The social share preview link isn't working for me but I get what you're after. Right now we're not set up for SSR and I'm not sure that's a bridge that makes sense to cross now - serving a static site with some microservices attached is a really scalable design (also takes advantage of HTTP caching and CDN layers). Going to noodle on it a bit as a quick answer isn't coming to me. If y'all have some def please raise 🙂 Y'all may have noticed a new repo: https://github.com/TBD54566975/google-calendar-api This is the server indirection. I have open issues there for stuff I still need to do. But if anyone is curious to run this thing or otherwise code review my likely horrible Node code, have at it. * You'll need to copy .env.example to .env * ...and then fill it in with values I can give to any TBD employee * Then, standard nvm use, npm i, and node calendar.js to run @leordev This is the bit we should get running on server infra once I've converted it to an Express app and filled out the README. Then @EbonyL-tbd will have cool endpoints to hit in handling the frontend piece for the dev site. I'll file a ticket for how to do that when we're live. Also if there's a better repo name for this I'm all ears. It's obviously not a true google-calendar-api but rather our very limited indirection which pulls N events from any Google Calendar and returns them in our own JSON format. @EbonyL-tbd I updated the front end issue for the dev site and attached some mock data you can use to get going until we hook up the service: https://github.com/TBD54566975/developer.tbd.website/issues/340 Ping us if you have any questions and have fun with it!
EbonyL❤
EbonyL❤•14mo ago
Thanks 🙌🏾
Unknown User
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
ALR
ALROP•14mo ago
EbonyL❤
EbonyL❤•14mo ago
just to update you guys, I'm going to get started on this next week
ALR
ALROP•14mo ago
@EbonyL-tbd There’s also a service now which you can run locally and hit real endpoints @EbonyL-tbd Wrote up a README for ya; lemme know if you run into issues: https://github.com/TBD54566975/google-calendar-api/blob/main/README.md
EbonyL❤
EbonyL❤•13mo ago
I'm getting started on this now, I'm in the dashboard but I don't have access to the API keys, can someone give me permission pls? @ALR
ALR
ALROP•13mo ago
Absolutely! On Slack.
Want results from more Discord servers?
Add your server