zoom_launcher 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +16 -7
- data/lib/google/apis/calendar_v3/event.rb +20 -3
- data/lib/zoom_launcher/cli.rb +6 -5
- data/lib/zoom_launcher/google_auth.rb +1 -1
- data/lib/zoom_launcher/version.rb +1 -1
- data/zoom_launcher.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a97115f729c88166794dd66c165edef9f485dc55
|
4
|
+
data.tar.gz: '08c006a6948afc194ca8aed68764caeb101716a3'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce8c748864d9bc5f73f9f56852f3b9d34922eef47d96e99e5de6a997aa74d3f271786465af723b1b78e17b47dd7babe6852721d74647b4a2877974639f05f6bb
|
7
|
+
data.tar.gz: 766228884541290465858cf0dacd87bd2e2834574e30bfd7974489984b202319b333943c65f4727e552aaea2aed09a461779cd2c3c9e16314187729634fdf08b
|
data/README.md
CHANGED
@@ -19,13 +19,22 @@ Oh, and here's the URL in case you need it: https://www.google.com/calendar/even
|
|
19
19
|
|
20
20
|
## Setup
|
21
21
|
|
22
|
-
In order to use Zoom Launcher, you need to create an OAuth app and authorize it to access your calendar:
|
23
|
-
|
24
|
-
1.
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
In order to use Zoom Launcher, you need to create an OAuth app and authorize it to access your calendar. You can do it in four, not-so-easy steps:
|
23
|
+
|
24
|
+
1. Create a new project
|
25
|
+
1. Go to https://console.developers.google.com
|
26
|
+
2. Switch to your work account if need be (top right)
|
27
|
+
3. Create a new project dropdown, top left next to your domain
|
28
|
+
2. Grant the project Calendar API access
|
29
|
+
1. Click "Enable API"
|
30
|
+
2. Type "Calendar" in the search box
|
31
|
+
3. Click "Calendar API"
|
32
|
+
4. Click "Enable"
|
33
|
+
3. Grab your creds
|
34
|
+
1. Click "Credentials" on the left side
|
35
|
+
2. Create a new OAuth credential with type "other"
|
36
|
+
3. Download the credential to `~/.config/google/client_secrets.json` (icon, right side)
|
37
|
+
4. Run `zoom auth` and follow the instructions to authorize the app
|
29
38
|
|
30
39
|
## Project status
|
31
40
|
|
@@ -4,12 +4,19 @@ module Google
|
|
4
4
|
module Apis
|
5
5
|
module CalendarV3
|
6
6
|
class Event
|
7
|
-
MEETING_URL_REGEX = %r{https
|
7
|
+
MEETING_URL_REGEX = %r{https://.*?\.zoom\.us/(?:j/(\d+)|my/(\S+))}
|
8
8
|
include ActionView::Helpers::DateHelper
|
9
9
|
|
10
|
+
def meeting_id
|
11
|
+
@meeting_id ||= (matches[1] || matches[2])
|
12
|
+
end
|
13
|
+
|
10
14
|
def meeting_url
|
11
|
-
|
12
|
-
|
15
|
+
@meeting_url ||= URI(matches[0]) if matches
|
16
|
+
end
|
17
|
+
|
18
|
+
def zoom_url
|
19
|
+
"zoommtg://zoom.us/join?confno=#{meeting_id}" if meeting_id && !vanity_url?
|
13
20
|
end
|
14
21
|
|
15
22
|
def already_started?
|
@@ -28,6 +35,16 @@ module Google
|
|
28
35
|
"in #{distance}".bold
|
29
36
|
end
|
30
37
|
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def matches
|
42
|
+
@matches ||= "#{location} #{description}".match(MEETING_URL_REGEX)
|
43
|
+
end
|
44
|
+
|
45
|
+
def vanity_url?
|
46
|
+
meeting_id && meeting_id !~ /\A\d+\z/
|
47
|
+
end
|
31
48
|
end
|
32
49
|
end
|
33
50
|
end
|
data/lib/zoom_launcher/cli.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'uri'
|
4
|
+
|
3
5
|
module ZoomLauncher
|
4
6
|
class CLI < GoogleAuth
|
5
7
|
CALENDAR = 'primary'
|
@@ -22,15 +24,14 @@ module ZoomLauncher
|
|
22
24
|
puts
|
23
25
|
|
24
26
|
if next_event.more_than_five_minutes_from_now?
|
25
|
-
puts "Here's the Zoom URL: #{next_event.meeting_url.bold}"
|
27
|
+
puts "Here's the Zoom URL: #{next_event.meeting_url.to_s.bold}"
|
26
28
|
else
|
27
|
-
puts "Opening #{next_event.meeting_url.bold}..."
|
28
|
-
`open #{next_event.meeting_url}`
|
29
|
-
|
29
|
+
puts "Opening #{next_event.meeting_url.to_s.bold}..."
|
30
|
+
`open #{next_event.zoom_url || next_event.meeting_url}`
|
30
31
|
end
|
31
32
|
puts "Oh, and here's the URL in case you need it: #{next_event.html_link}"
|
32
33
|
else
|
33
|
-
puts "Can't find any
|
34
|
+
puts "Can't find any upcoming Zoom meetings"
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
data/zoom_launcher.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.email = ['ben.balter@github.com']
|
13
13
|
|
14
14
|
spec.summary = 'A command line tool for joining your next Zoom meeting'
|
15
|
-
spec.homepage =
|
15
|
+
spec.homepage = 'https://github.com/benbalter/zoom-launcher'
|
16
16
|
spec.license = 'MIT'
|
17
17
|
|
18
18
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zoom_launcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Balter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|