diff --git a/home/.local/bin/cryptorate b/home/.local/bin/cryptorate index 454496a..82e5a53 100755 --- a/home/.local/bin/cryptorate +++ b/home/.local/bin/cryptorate @@ -3,5 +3,5 @@ if [ -n "$2" ]; then curl "$2.rate.sx/$1" else - curl "rate.sx/$1" + curl "rate.sx/${1:-}" fi diff --git a/home/.local/bin/grab b/home/.local/bin/grab index 481f295..bdba92e 100755 --- a/home/.local/bin/grab +++ b/home/.local/bin/grab @@ -1,3 +1,3 @@ #!/bin/sh -curl -s "$1" | pandoc --from=html --to=markdown | glow - -s dark -w 80 | less -r +curl -s "${1:--}" | pandoc --from=html --to=markdown | glow - -s dark -w 80 | less -r diff --git a/home/.local/bin/ipinfo b/home/.local/bin/ipinfo index 528ba83..3097b2c 100755 --- a/home/.local/bin/ipinfo +++ b/home/.local/bin/ipinfo @@ -2,4 +2,4 @@ # $1=geo for verbose look up -curl -s "https://ipinfo.io/$1" | jq . +curl -s "https://ipinfo.io/${1:-}" | jq . diff --git a/home/.local/bin/lyrics b/home/.local/bin/lyrics index 08e629d..6e87b88 100755 --- a/home/.local/bin/lyrics +++ b/home/.local/bin/lyrics @@ -6,11 +6,9 @@ echo "Song: " | tr -d '\n' read -r song # Nice look -echo "======================== - -" +echo "========================" artist=$(echo "$artist" | sed s/" "/%20/g | sed s/"&"/%26/g | sed s/,/%2C/g | sed s/-/%2D/g) song=$(echo "$song" | sed s/" "/%20/g | sed s/"&"/%26/g | sed s/,/%2C/g | sed s/-/%2D/g) -curl -s "https://api.lyrics.ovh/v1/$artist/$song" | jq -r ".lyrics" +curl -s "https://api.lyrics.ovh/v1/$artist/$song" | jq -r ".lyrics" | sed '/\r$/d' diff --git a/home/.local/bin/moon b/home/.local/bin/moon index 591ac58..4a6a855 100755 --- a/home/.local/bin/moon +++ b/home/.local/bin/moon @@ -1,3 +1,3 @@ #!/bin/sh -curl -s "https://wttr.in/Moon$1" +curl -s "https://wttr.in/Moon${1:-}" diff --git a/home/.local/bin/qrgen b/home/.local/bin/qrgen index f06a0e2..d091bcf 100755 --- a/home/.local/bin/qrgen +++ b/home/.local/bin/qrgen @@ -3,4 +3,4 @@ # When you don't want to install `qrencode` yourself input=$(printf '%s ' "$@") input=$(echo "$input" | sed s/" "/%20/g) -curl "qrenco.de/$input" +curl "https://qrenco.de/$input" diff --git a/home/.local/bin/urlify b/home/.local/bin/urlify index 1fdc5ec..5e2640a 100755 --- a/home/.local/bin/urlify +++ b/home/.local/bin/urlify @@ -1,9 +1,9 @@ #!/bin/sh if [ "$1" = "-e" ]; then - curl https://unshorten.me/s/"$2" + curl https://unshorten.me/s/"${2:--}" elif [ "$1" = "-s" ]; then - curl https://tinyurl.com/api-create.php?url="$2" + curl -F"shorten=${2:--}" https://0x0.st else echo "Wrong arguments" return 1 diff --git a/home/.local/bin/wttr b/home/.local/bin/wttr index a2ad092..240689a 100755 --- a/home/.local/bin/wttr +++ b/home/.local/bin/wttr @@ -1,9 +1,9 @@ #!/bin/sh if [ "$2" = "-v2" ]; then - curl "https://v2.wttr.in/$1" + curl "https://v2.wttr.in/${1:-}" elif [ "$2" = "-v3" ]; then - curl "https://v3.wttr.in/$1.sxl" + curl "https://v3.wttr.in/${1:-}.sxl" else - curl "https://wttr.in/$1" + curl "https://wttr.in/${1:-}" fi