-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathverify-event.ts
More file actions
36 lines (30 loc) · 1.07 KB
/
verify-event.ts
File metadata and controls
36 lines (30 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { connectToSuperhuman, disconnect } from "./src/superhuman-api";
async function verifyFamilyEvent() {
const conn = await connectToSuperhuman(9333, true);
if (!conn) return;
const result = await conn.Runtime.evaluate({
expression: `
(async () => {
try {
const ga = window.GoogleAccount;
const di = ga?.di;
const gcal = di?.get?.('gcal');
const accountEmail = ga?.emailAddress;
const calendarId = "family11935540803478838785@group.calendar.google.com";
const events = await gcal.getEventsList(
{ calendarId, calendarAccountEmail: accountEmail },
{ timeMin: "2026-02-18T00:00:00Z", timeMax: "2026-02-19T00:00:00Z" }
);
return { success: true, events: events?.items || events };
} catch (e) {
return { success: false, error: e.message };
}
})()
`,
returnByValue: true,
awaitPromise: true
});
console.log(JSON.stringify(result.result.value, null, 2));
await disconnect(conn);
}
verifyFamilyEvent();