Skip to content

Instantly share code, notes, and snippets.

@ValentinH
Created December 20, 2021 16:14
Show Gist options
  • Select an option

  • Save ValentinH/cb636bbd1f0ebd4231ff16482ee8dd5c to your computer and use it in GitHub Desktop.

Select an option

Save ValentinH/cb636bbd1f0ebd4231ff16482ee8dd5c to your computer and use it in GitHub Desktop.

Revisions

  1. ValentinH created this gist Dec 20, 2021.
    27 changes: 27 additions & 0 deletions meet.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    // Menu: Meet
    // Description: Start new meet and paste on Slack
    // Author: Valentin Hervieu
    // Twitter: @ValentinHervieu

    import "@johnlindquist/kit"

    async function sleep(time = 1000) {
    return new Promise(resolve => setTimeout(resolve, time))
    }

    browse('https://meet.new')
    let count = 1
    let tab = ''

    while (count < 20) {
    await sleep(500)
    tab = await getActiveTab("Brave")
    if (!tab.startsWith('https://meet.google.com/new')) break
    count += 1
    }

    tab = tab.split('?')[0]

    await copy(tab)
    await focusWindow('Slack', '')
    await setSelectedText(tab)