From e3a351b1b4228fe82e3365a2704c0ef773f0d51e Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Tue, 11 May 2021 16:08:13 -0500 Subject: [PATCH] change TWiN to use html_url instead of api url --- this_week_in_nu.nu | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/this_week_in_nu.nu b/this_week_in_nu.nu index b2fd3db..b4946fd 100644 --- a/this_week_in_nu.nu +++ b/this_week_in_nu.nu @@ -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)