Skip to content

Commit 7a59ee5

Browse files
authored
add stargazer script to monitor nushell stars (nushell#260)
1 parent 0ea59f4 commit 7a59ee5

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

webscraping/shell_stars.nu

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
let shell_list = [
2+
[name repo];
3+
[bash bminor/bash]
4+
[fish fish-shell/fish-shell]
5+
[nushell nushell/nushell]
6+
# [powershell no-github-url]
7+
[pwsh PowerShell/PowerShell]
8+
[ksh2020 ksh2020/ksh]
9+
[ksh93u att/ast]
10+
# [csh no-github-url]
11+
# [dash no-github-url]
12+
# [sh no-github-url]
13+
# [cmd no-github-url]
14+
[aws-shell awslabs/aws-shell]
15+
[azure-cloud-shell Azure/CloudShell]
16+
[elvish elves/elvish]
17+
[es wryun/es-shell]
18+
[ion redox-os/ion]
19+
[MirBSDksh MirBSD/mksh]
20+
[ngs ngs-lang/ngs]
21+
[openbsd_ksh ibara/oksh]
22+
[oil oilshell/oil]
23+
[shell++ alexst07/shell-plus-plus]
24+
[tcsh tcsh-org/tcsh]
25+
[xonsh xonsh/xonsh]
26+
[yash magicant/yash]
27+
[zsh zsh-users/zsh]
28+
]
29+
30+
$shell_list | each { |r|
31+
print -n $"Working on ($r.name)"
32+
sleep 250ms
33+
if ($r.repo | str starts-with no) {
34+
[[shell repo stars]; [($r.name) "no github url" 0]]
35+
print ""
36+
} else {
37+
let url = $"https://api.github.com/repos/($r.repo)"
38+
let count = (fetch -u $env.GITHUB_USERNAME -p $env.GITHUB_PASSWORD ($url) | get stargazers_count)
39+
print $" ($count)"
40+
[[shell repo stars]; [($r.name) ($r.repo) ($count)]]
41+
}
42+
} | flatten | sort-by -r stars | table -n 1

0 commit comments

Comments
 (0)