-
-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathissues-top-10.bash
More file actions
executable file
·27 lines (24 loc) · 768 Bytes
/
issues-top-10.bash
File metadata and controls
executable file
·27 lines (24 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
gen() {
echo '<!DOCTYPE html><html><body><table>'
gh issue list -R josh-berry/tab-stash -L 1000 \
--json url,title,reactionGroups,createdAt \
|jq -r '
map(
.reactionGroups |= map(select(.content=="THUMBS_UP"))[0]
|{
url: .url,
title: .title,
age: ((now - (.createdAt|fromdate)) / (24*60*60)),
votes: ((.reactionGroups?.users?.totalCount // 0) + 1)
}
|select(.votes >= 3)
|(.voteVelocity = .votes / .age)
)
|sort_by(-.voteVelocity)
|.[]
|"<tr><td>\(.votes)v/\(.age|floor)d</td><td><a href=\"\(.url)\">\(.title)</a></td></tr>"
' |head -n 10
echo '</table></body></html>'
}
open -a firefox "data:text/html;base64,$(gen|base64)"