Skip to content

Commit a465a06

Browse files
authored
Overhaul categorization on events page (#2328)
This PR: - overhauls the categorization logic by heuristically recognizing the calendar titles and bucketing them as such - splits out "foundation meetings" from "working groups" (but does not add any styles for the former) - shows "major" events before "minor" events - i.e. conferences and locals before working groups/foundation meetings - changes the link for calendar events to be the event location (if it's a URL) or the first link in the description otherwise - changes the location for calendar events to be from the calendar - expands the visibility window for working groups to 35.5 days so we can be sure at least one of each type is shown - applies the visibility window to foundation meetings and working groups, but not other events on the calendar (e.g. conferences, locals, etc) - excludes GraphQLConf coming from the calendar to avoid duplicating manual definition - shows the tags in a consistent order (conferences > meetups > working groups > foundation meetings)
1 parent e6f1f14 commit a465a06

File tree

6 files changed

+520
-72
lines changed

6 files changed

+520
-72
lines changed

scripts/sync-working-groups/sync-working-groups.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ const CALENDAR_ID =
77
"linuxfoundation.org_ik79t9uuj2p32i3r203dgv5mo8@group.calendar.google.com"
88
const API_KEY = process.env.GOOGLE_CALENDAR_API_KEY
99
const OUTPUT_FILE = new URL("./working-group-events.ndjson", import.meta.url)
10-
const DAYS_BACK = 30
10+
const DAYS_BACK = 36
1111
const DAYS_TO_KEEP = 90
12-
const DAYS_AHEAD = 30
12+
const DAYS_AHEAD = 500
1313

1414
const Instant = type({
1515
"dateTime?": "string",
@@ -40,6 +40,7 @@ const responseSchema = type({
4040
"nextPageToken?": "string",
4141
})
4242

43+
/** Misnomer, this is just an event from the public calendar, not necessarily a working group */
4344
export type WorkingGroupMeeting =
4445
typeof calendarEventSchema.inferIntrospectableOut
4546

@@ -63,6 +64,8 @@ async function main() {
6364
const searchParams = new URLSearchParams({
6465
key: API_KEY,
6566
singleEvents: "true",
67+
orderBy: "startTime",
68+
maxResults: "250",
6669
})
6770

6871
const timeMin =
@@ -73,7 +76,6 @@ async function main() {
7376
const timeMax = new Date(now.getTime() + DAYS_AHEAD * 24 * 60 * 60 * 1000)
7477
searchParams.set("timeMin", timeMin.toISOString())
7578
searchParams.set("timeMax", timeMax.toISOString())
76-
searchParams.set("orderBy", "startTime")
7779
console.log(
7880
`\nSyncing from: ${timeMin.toLocaleDateString()} (${timeMin.toISOString()})`,
7981
)

0 commit comments

Comments
 (0)