twitch-notify: fix incorrect syntax
This commit is contained in:
parent
0ef45f29ad
commit
097ba6851f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue