Added error checking to jokes.
This commit is contained in:
1 parent
96b4400f5e
commit
0aaef3c43a
1 file changed
+2
-2
@@ -1,5 +1,5 @@
|
||||
[ -f functions.sh ] && source functions.sh
|
||||
|
||||
joke="$(curl -s 'https://thatsagooden.tk/?api=txt&type=all&exclude=sex,little_johnny')"
|
||||
joke="$(curl -s --connect-timeout 5 'https://thatsagooden.tk/?api=txt&type=all&exclude=sex,little_johnny')"
|
||||
joke="${joke//[[:space:]]/ }"
|
||||
msg "$2" "$joke"
|
||||
[ -n "$joke" ] && msg "$2" "$joke" || msg "$2" "No jokes found."
|
||||
Reference in new issue
Block a user