mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00:00
change TWiN to use html_url instead of api url
This commit is contained in:
parent
fdf8cf2e90
commit
e3a351b1b4
1 changed files with 7 additions and 23 deletions
|
@ -1,10 +1,10 @@
|
|||
# fetch https://api.github.com/repos/nushell/nushell/pulls?q=is%3Apr+merged%3A%3E%3D2021-04-20+ | select url user.login title body
|
||||
# fetch https://api.github.com/search/issues?q=repo:nushell/vscode-nushell-lang+is:pr+is:merged+merged:%3E2021-04-01 | get items | select url user.login title body
|
||||
# fetch https://api.github.com/repos/nushell/nushell/pulls?q=is%3Apr+merged%3A%3E%3D2021-04-20+ | select html_url user.login title body
|
||||
# fetch https://api.github.com/search/issues?q=repo:nushell/nushell+is:pr+is:merged+merged:%3E2021-05-08 | get items | select html_url user.login title body
|
||||
# Repos to monitor
|
||||
|
||||
def do-work [] {
|
||||
let site_table = [
|
||||
[site url
|
||||
[site repo
|
||||
]; [Nushell nushell
|
||||
] [Extension vscode-nushell-lang
|
||||
] [Documentation nushell.github.io
|
||||
|
@ -18,25 +18,9 @@ def do-work [] {
|
|||
let query_date = $(seq date --days 7 -r | last)
|
||||
let query_suffix = $(build-string "+is:pr+is:merged+merged:%3E%3D" $query_date)
|
||||
|
||||
# let entries = $(echo $site_table | each {
|
||||
# let query_string = $(build-string $query_prefix $it.url $query_suffix)
|
||||
# let site_json = $(fetch $query_string | get items | select url user.login title)
|
||||
# build-string '## ' $(echo $it.site) $(char nl) $(char nl)
|
||||
# if $(= $site_json | empty?) {
|
||||
|
||||
# } {
|
||||
# echo $site_json | each {
|
||||
# build-string '- ' $it.user_login ' created [' $it.title '](' $it.url ')' $(char nl)
|
||||
# } | str collect
|
||||
# build-string $(char nl)
|
||||
# }
|
||||
# # We need 2 seconds between fetches or github's api limiting will limit us
|
||||
# sleep 2sec
|
||||
# })
|
||||
|
||||
let entries = $(echo $site_table | each {
|
||||
let query_string = $(build-string $query_prefix $it.url $query_suffix)
|
||||
let site_json = $(fetch $query_string | get items | select url user.login title)
|
||||
let query_string = $(build-string $query_prefix $it.repo $query_suffix)
|
||||
let site_json = $(fetch $query_string | get items | select html_url user.login title)
|
||||
build-string '## ' $(echo $it.site) $(char nl) $(char nl)
|
||||
if $(= $site_json | empty?) {
|
||||
build-string "none found this week" $(char nl) $(char nl)
|
||||
|
@ -48,9 +32,9 @@ def do-work [] {
|
|||
# only print the comma if there's another item
|
||||
let user_prs = $(echo $it.prs | each -n {
|
||||
if $pr_count == $(= $it.index + 1) {
|
||||
build-string '[' $it.item.title '](' $it.item.url ')'
|
||||
build-string '[' $it.item.title '](' $it.item.html_url ')'
|
||||
} {
|
||||
build-string '[' $it.item.title '](' $it.item.url '), and '
|
||||
build-string '[' $it.item.title '](' $it.item.html_url '), and '
|
||||
}
|
||||
} | str collect)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue