1
0
Fork 0
dotfiles/home/programs/scripts/bdfr

44 lines
871 B
Text
Raw Normal View History

2023-12-11 23:31:51 +00:00
#!/usr/bin/env nu
2023-12-13 20:03:46 +00:00
let base_url = "https://media-browser.internal.kempkens.network/management/jobs/BdfrDownload/run?"
def "main subreddit" [
subreddit: string
2023-12-11 23:31:51 +00:00
--sort: string = "hot"
2023-12-13 20:03:46 +00:00
--limit: int = 999
2023-12-11 23:31:51 +00:00
] {
2023-12-13 20:03:46 +00:00
let url = $"($base_url)args[subreddit]=($subreddit)&args[sort]=($sort)&args[limit]=($limit)"
2023-12-11 23:31:51 +00:00
http get $url | ignore
}
2023-12-13 20:03:46 +00:00
def "main user" [
user: string
--limit: int = 9999
] {
let url = $"($base_url)args[user]=($user)&args[limit]=($limit)"
http get $url | ignore
}
2024-04-17 07:56:43 +00:00
def "main search" [
subreddit: string
search: string
--limit: int = 9999
] {
let url = $"($base_url)args[subreddit]=($subreddit)&args[search]=($search)&args[limit]=($limit)"
http get $url | ignore
}
2024-07-05 08:03:24 +00:00
def "main post" [
post: string
] {
let reddit_url = $post | url encode
let url = $"($base_url)args[link]=($reddit_url)"
http get $url | ignore
}
2023-12-13 20:03:46 +00:00
def main [] {}