You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: development/scripts/build-meetings.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
## Build meetings script
2
2
3
-
####Summary
3
+
### Summary
4
4
5
5
This script is a Node.js module that interacts with the Google Calendar API to fetch upcoming meetings and writes the data to a specified file path. It uses the Google APIs client library to authenticate and access calendar events. The script is designed to be run as a cron job, fetching events within a specified time range and logging the results. It handles authentication, data fetching, and error management, ensuring that the data structure received from the API is valid before processing.
6
6
7
-
####Overview
7
+
### Overview
8
8
9
9
-**Purpose**: Fetch upcoming meetings from Google Calendar and save them to a JSON file.
10
10
-**Language**: TypeScript
@@ -14,7 +14,7 @@ This script is a Node.js module that interacts with the Google Calendar API to f
14
14
-`path` and `url` for file path manipulations
15
15
- A custom logger utility for logging information
16
16
17
-
####Key Components
17
+
### Key Components
18
18
19
19
1.**Authentication**:
20
20
- Uses `google.auth.GoogleAuth` for OAuth2 authentication.
@@ -35,7 +35,7 @@ This script is a Node.js module that interacts with the Google Calendar API to f
35
35
- Writes the processed event data to a specified JSON file.
36
36
- Logs the fetched events using a custom logger.
37
37
38
-
####Development Setup
38
+
### Development Setup
39
39
40
40
1.**Prerequisites**:
41
41
- Node.js and npm installed
@@ -66,7 +66,7 @@ This script is a Node.js module that interacts with the Google Calendar API to f
66
66
tsx scripts/build-meetings.ts
67
67
```
68
68
69
-
#### Usage
69
+
### Usage
70
70
71
71
- **Environment Variables**:
72
72
- `CALENDAR_SERVICE_ACCOUNT`: JSON string of service account credentials.
@@ -76,17 +76,17 @@ This script is a Node.js module that interacts with the Google Calendar API to f
76
76
- The script can be executed directly to fetch and write meeting data to `meetings.json`in the `config` directory.
77
77
- It is designed to be run as a cron job at midnight.
78
78
79
-
#### Command
79
+
### Command
80
80
81
81
To run the script manually, ensure the environment variables are set and execute:
82
82
83
83
```bash
84
84
tsx scripts/build-meetings.ts
85
85
```
86
86
87
-
#### Output
87
+
### Output
88
88
The output will be a JSON file containing an array of upcoming meetings with details such as title, calendar link, GitHub issue URL, banner, and date. The file will be saved in the specified path (e.g., `../config/meetings.json`).
89
89
90
-
#### Notes
90
+
### Notes
91
91
- Ensure that the Google Calendar API is enabled for the project associated with the service account.
92
92
- The script is designed to be run in a Node.js environment with TypeScript support.
0 commit comments