mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-11-25 00:38:23 -05:00
scripts: fix syntax + use 0x0.st for url shortening
This commit is contained in:
parent
9b81f9b07b
commit
5b79df9f6f
@ -3,5 +3,5 @@
|
|||||||
if [ -n "$2" ]; then
|
if [ -n "$2" ]; then
|
||||||
curl "$2.rate.sx/$1"
|
curl "$2.rate.sx/$1"
|
||||||
else
|
else
|
||||||
curl "rate.sx/$1"
|
curl "rate.sx/${1:-}"
|
||||||
fi
|
fi
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
#!/bin/sh
|
#!/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
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
# $1=geo for verbose look up
|
# $1=geo for verbose look up
|
||||||
|
|
||||||
curl -s "https://ipinfo.io/$1" | jq .
|
curl -s "https://ipinfo.io/${1:-}" | jq .
|
||||||
|
@ -6,11 +6,9 @@ echo "Song: " | tr -d '\n'
|
|||||||
read -r song
|
read -r song
|
||||||
|
|
||||||
# Nice look
|
# Nice look
|
||||||
echo "========================
|
echo "========================"
|
||||||
|
|
||||||
"
|
|
||||||
|
|
||||||
artist=$(echo "$artist" | sed s/" "/%20/g | sed s/"&"/%26/g | sed s/,/%2C/g | sed s/-/%2D/g)
|
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)
|
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'
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
curl -s "https://wttr.in/Moon$1"
|
curl -s "https://wttr.in/Moon${1:-}"
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
# When you don't want to install `qrencode` yourself
|
# When you don't want to install `qrencode` yourself
|
||||||
input=$(printf '%s ' "$@")
|
input=$(printf '%s ' "$@")
|
||||||
input=$(echo "$input" | sed s/" "/%20/g)
|
input=$(echo "$input" | sed s/" "/%20/g)
|
||||||
curl "qrenco.de/$input"
|
curl "https://qrenco.de/$input"
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ "$1" = "-e" ]; then
|
if [ "$1" = "-e" ]; then
|
||||||
curl https://unshorten.me/s/"$2"
|
curl https://unshorten.me/s/"${2:--}"
|
||||||
elif [ "$1" = "-s" ]; then
|
elif [ "$1" = "-s" ]; then
|
||||||
curl https://tinyurl.com/api-create.php?url="$2"
|
curl -F"shorten=${2:--}" https://0x0.st
|
||||||
else
|
else
|
||||||
echo "Wrong arguments"
|
echo "Wrong arguments"
|
||||||
return 1
|
return 1
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if [ "$2" = "-v2" ]; then
|
if [ "$2" = "-v2" ]; then
|
||||||
curl "https://v2.wttr.in/$1"
|
curl "https://v2.wttr.in/${1:-}"
|
||||||
elif [ "$2" = "-v3" ]; then
|
elif [ "$2" = "-v3" ]; then
|
||||||
curl "https://v3.wttr.in/$1.sxl"
|
curl "https://v3.wttr.in/${1:-}.sxl"
|
||||||
else
|
else
|
||||||
curl "https://wttr.in/$1"
|
curl "https://wttr.in/${1:-}"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user