I rely on Google Calendar and macOS Calendar to remind me of time commitments. Some events I care about are managed by other people, making them hard

Turning data into calendar feeds

submited by
Style Pass
2025-01-07 14:00:08

I rely on Google Calendar and macOS Calendar to remind me of time commitments. Some events I care about are managed by other people, making them hard to track in my calendar apps.

Calendar clients support a basic way of reading dynamic calendar data from external sources. You need a URL that hosts an iCalendar feed, effectively a link to a dynamic .ics file.

You can produce data in the iCalendar format from JavaScript with the ical-generator package. How you source data for calendar events up to you. For Notion, I used the Notion API. For other sites, you may need to write custom scraping logic.

Initially I considered populating calendars with the Google Calendar API, but I preferred the iCalendar feed approach because:

Once you have code that produces an iCalendar feed, you need to host it on the internet. You can host this any way you like (e.g. Vercel, Netlify, Glitch, VPS), but I prefer Val Town for this sort of task.

With Val Town you can instantly create one-off HTTP endpoints that run JavaScript. These are lightweight functions powered by the Deno runtime. Because they’re so cheap and efficient, Val Town offers a generous free tier with unlimited public “Vals”. It’s similar to Glitch in that projects can handle backend requests at a public URL, but more lightweight and focused on single-file scripts reminiscent of JSFiddle.

Leave a Comment