-
-
Save miyagawa/986e4034a09e6c822a832a4e283f331f to your computer and use it in GitHub Desktop.
Open Zoom (or whatever video conference) URL in the current calendar event with gcalcli (https://github.com/insanum/gcalcli)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
my $calendar = 'your-calendar@example.com'; | |
my $regex = qr!https?://\w+\.zoom\.us/j/\d+(?:\?pwd=[\w\-_]+)?!; # change to your conference software | |
my $now = localtime(); | |
my $end = localtime(time + 3600); | |
my $cal = `gcalcli --refresh --calendar=$calendar agenda --nodeclined "$now" "$end" --details all --tsv`; | |
for my $event (split /\n/, $cal) { | |
my @data = split /\t/, $event; | |
if ($event =~ /($regex)/) { | |
print "$data[8]\n"; # title | |
warn "Opening $1\n"; | |
system "open", $1; | |
exit; | |
} | |
} | |
print "No event or Zoom URL found.\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment