aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-09-21 15:13:57 -0700
committerFuwn <[email protected]>2023-09-21 15:13:57 -0700
commitb7f62057db838063a23d75d62df2ce61101eb2a2 (patch)
treefd2f6bc1730dbf5516b8a05ac163a13a4253783d
parentfix(suzuri): shell-checks (diff)
downloadsuzuri-b7f62057db838063a23d75d62df2ce61101eb2a2.tar.xz
suzuri-b7f62057db838063a23d75d62df2ce61101eb2a2.zip
refactor(suzuri): use constants
-rwxr-xr-xsuzuri7
1 files changed, 4 insertions, 3 deletions
diff --git a/suzuri b/suzuri
index 9c66f14..ff95906 100755
--- a/suzuri
+++ b/suzuri
@@ -1,11 +1,12 @@
#!/usr/bin/env bash
+ROOT_URL="https://sumi.news/"
token="${1:-"${SUZURI_TOKEN}"}"
folder="${2:-"${SUZURI_FOLDER}"}"
if [[ -z "${token}" ]]; then
cat <<EOF
-usage: sumi token [folder]
+usage: $(basename "${0}") token [folder]
positional arguments:
token sumi.news session token
@@ -30,9 +31,9 @@ curl_command=(
)
if [[ -n "${folder}" ]]; then
- curl_command+=("https://sumi.news/?folder=${folder}")
+ curl_command+=("${ROOT_URL}?folder=${folder}")
else
- curl_command+=("https://sumi.news/")
+ curl_command+=("${ROOT_URL}")
fi
body="$("${curl_command[@]}" | pup '.mt-6' | html2md -i || true)"