From fbb59e80f16c85b56907874547b37defef9b1a96 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Wed, 13 Dec 2023 21:03:46 +0100 Subject: [PATCH] bdfr: update script --- home/programs/scripts/bdfr | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/home/programs/scripts/bdfr b/home/programs/scripts/bdfr index b677235..350ed3f 100755 --- a/home/programs/scripts/bdfr +++ b/home/programs/scripts/bdfr @@ -1,10 +1,24 @@ #!/usr/bin/env nu -def main [ - --subreddit: string +let base_url = "https://media-browser.internal.kempkens.network/management/jobs/BdfrDownload/run?" + +def "main subreddit" [ + subreddit: string --sort: string = "hot" + --limit: int = 999 ] { - let url = $"https://media-browser.internal.kempkens.network/management/jobs/BdfrDownload/run?args[subreddit]=($subreddit)&args[sort]=($sort)" + let url = $"($base_url)args[subreddit]=($subreddit)&args[sort]=($sort)&args[limit]=($limit)" http get $url | ignore } + +def "main user" [ + user: string + --limit: int = 9999 +] { + let url = $"($base_url)args[user]=($user)&args[limit]=($limit)" + + http get $url | ignore +} + +def main [] {}