triage_watcher.jl

 1## Triage Watcher v0.1
 2# This is a small script to watch for new issues on the Zed repository and open them in a new browser tab interactively.
 3#
 4## Installing Julia
 5#
 6# You need Julia installed on your system:
 7# curl -fsSL https://install.julialang.org | sh
 8#
 9## Running this script:
10# 1. It only works on Macos/Linux
11# Open a new Julia repl with `julia` inside the `zed` repo
12# 2. Paste the following code
13# 3. Whenever you close your computer, just type the Up arrow on the REPL + enter to rerun the loop again to resume
14function get_issues()
15    entries = filter(x -> occursin("state:needs triage", x), split(read(`gh issue list -L 10`, String), '\n'))
16    top = findfirst.('\t', entries) .- 1
17    [entries[i][begin:top[i]] for i in eachindex(entries)]
18end
19
20nums = get_issues();
21while true
22    new_nums = get_issues()
23    # Open each new issue in a new browser tab
24    for issue_num in setdiff(new_nums, nums)
25        url = "https://github.com/zed-industries/zed/issues/" * issue_num
26        println("\nOpening $url")
27        open_tab = `/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome $url`
28        try
29            sound_file = "/Users/mrg/Downloads/mario_coin_sound.mp3"
30            run(`afplay -v 0.02 $sound_file`)
31        finally
32        end
33        run(open_tab)
34    end
35    nums = new_nums
36    print("🧘🏼")
37    sleep(60)
38end