twitch-notify: fix incorrect syntax

This commit is contained in:
yosh 2023-09-21 10:04:51 -04:00
parent 0ef45f29ad
commit 097ba6851f
1 changed files with 2 additions and 2 deletions

View File

@ -28,12 +28,12 @@ check() {
tmphtml="$2"
max_tries=2
trap 'innerclean "$tmphtml"' INT HUP TERM EXIT
curl -s -o "$2" -L "https://twitch.tv/$1"
curl --connect-timeout 10 -s -o "$2" -L "https://twitch.tv/$1"
if [ -n "$(pup 'script[type="application/ld+json"]' < "$2")" ]; then
if [ ! -f "$DIR/$1" ]; then
touch "$DIR/$1"
IMG="$(mktemp -t "twitch-notify-img.XXXX")"
curl -s -o "$IMG" -L "$(pup 'meta[property="og:image"]' 'attr{content}' < "$2")"
curl --connect-timeout 10 -s -o "$IMG" -L "$(pup 'meta[property="og:image"]' 'attr{content}' < "$2")"
TITLE="$(pup 'script[type="application/ld+json"] text{}' < "$2" | jq -r '.[0].description')"
CODE="$(notify-send -A "watch" -A "copy" -t 10000 -u normal -i "$IMG" "$1 is online!$NL$NL\"$TITLE\"")"
case "${CODE:-999}" in