This project fetches events from multiple iCalendar (.ics) sources, combines them into a single calendar, and uploads the result to a DigitalOcean Space. It is designed to run on the YepCode platform every 10 minutes, but can be easily adapted to run in other Node.js environments.
- Fetches events from multiple iCalendar (.ics) sources
- combines events into a single calendar
- Handles recurring events, expanding them for a one-year period
- Adjusts event times to a specified timezone
- Generates a new .ics file with the combined events
- Uploads the resulting .ics file to a DigitalOcean Space
- A YepCode account
- YepCode CLI (optional, for downloading the project)
- A DigitalOcean account with Spaces enabled
-
Log in to your YepCode account and create a new project.
-
In the project dashboard, create a new process.
-
Copy the contents of
index.js
from this repository and paste it into the YepCode editor. -
Set up the following environment variables in YepCode:
PERSONAL_CALENDAR_URL
: URL of your personal iCalendarWORK_CALENDAR_URL
: URL of your work iCalendarDIGITALOCEAN_SPACES_ENDPOINT
: Your DigitalOcean Spaces endpointDIGITALOCEAN_SPACES_REGION
: Your DigitalOcean Spaces regionDIGITALOCEAN_SPACES_KEY
: Your DigitalOcean Spaces access keyDIGITALOCEAN_SPACES_SECRET
: Your DigitalOcean Spaces secret keyDIGITALOCEAN_SPACES_BUCKET
: The name of your DigitalOcean Space bucket
-
To set up a schedule for the script to run every 10 minutes:
- In the YepCode project dashboard, go to the "Schedules" section.
- Create a new schedule and select your process.
- Set the schedule to run every 10 minutes using a cron expression:
*/10 * * * *
- Save the schedule.
-
(Optional) To download the project using the YepCode CLI:
-
Install the YepCode CLI by following the instructions in the YepCode documentation.
-
Log in to your YepCode account using the CLI.
-
Use the
yepcode clone
(link) command to download your project:yepcode clone [TEAM]
Replace
TEAM
with your team id -
If you want to develop or test the script locally:
-
Clone this repository:
git clone https://github.com/diegomarino/combine-ics-calendars-in-yepcode.git cd combine-ics-calendars-in-yepcode
-
Initialize the project:
npm init -y
-
Create a
variables.env
file in the root directory with the environment variables listed above. -
Modify the
index.js
file to replace allyepcode.env.
references withprocess.env.
. You can do this manually or use a find-and-replace function in your text editor. -
Run the script locally:
node index.js
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.