insanum / gcalcli

Google Calendar Command Line Interface
MIT License
3.3k stars 311 forks source link

Add agenda detail option for `conferenceData` #533

Open michaelmhoffman opened 4 years ago

michaelmhoffman commented 4 years ago

The Zoom calendar extension for Google Calendar now stores data in a conferenceData object, as do Hangouts and Google Meet. It would be very helpful to have information on these in the agenda output.

Specifically, what I would like is to find the first entry_point in event["conferenceData"]["entryPoints"] with entry_point["entryPointType"] == "video" and output the URI.

conferenceData is described in the Google Calendar API for Events.

michaelmhoffman commented 4 years ago

What is needed is to create a new detail display. I would suggest --detail conference.

There is a lot of detail that could potentially be displayed but the conferenceData.entryPoints[].uri fields are the most important. Since I expect gcalcli is mainly run by power users, these might be the only outputs needed. I don't need to see the instructions or descriptions every time, just the entry point URIs.

For the text output, it is easy enough to display all entry points with their entryPointType. TSV output is slightly more challenging because there is a one-to-many relationship of events-to-entry points. So that the output is still a predictable, fixed number of columns for a given set of gcalcli options, I suggest adding only two columns: entryPoint.type and entryPoint.uri.

Alternatives for deciding which of the many entry points is added to the TSV output, with increasing complexity:

  1. Select only the first entry point (this works for my needs).
  2. Select only the first entry point that matches a specified priority entryPointType (default value: "video")
  3. Iterate over a set of priority entryPointTypes (default value: "video,phone,sip,more") and select only the first entry point that matches any of these. For example, if an event has both phone and sip entry points and the default priorities are set, only the phone entry point will be displayed.
  4. Display all entry points, space-separated. Spaces should not appear in URIs. Should escape any spaces with %20 in case they are supplied anyway. (This reduces complexity on the gcalcli side at the expense of added complexity on the side of whatever software consumes the output.)

Google Meet (built into Google Calendar) and Zoom for GSuite both populate the conferenceData properties and should be tested.

michaelmhoffman commented 4 years ago

Minimum of what needs changing for implementation:

Additional command-line or gcalclirc interface would be needed for prioritizing certain kinds of entry points (alternatives 2–3 above).

michaelmhoffman commented 4 years ago

This is implemented in michaelmhoffman/gcalcli@68fc986