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

44 lines
871 B
Text
Raw Normal View History

2023-12-12 00:31:51 +01:00
#!/usr/bin/env nu
2023-12-13 21:03:46 +01:00
let base_url = "https://media-browser.internal.kempkens.network/management/jobs/BdfrDownload/run?"
def "main subreddit" [
subreddit: string
2023-12-12 00:31:51 +01:00
--sort: string = "hot"
2023-12-13 21:03:46 +01:00
--limit: int = 999
2023-12-12 00:31:51 +01:00
] {
2023-12-13 21:03:46 +01:00
let url = $"($base_url)args[subreddit]=($subreddit)&args[sort]=($sort)&args[limit]=($limit)"
2023-12-12 00:31:51 +01:00
http get $url | ignore
}
2023-12-13 21:03:46 +01: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 09:56:43 +02: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 10:03:24 +02: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 21:03:46 +01:00
def main [] {}