about summary refs log tree commit diff
diff options
context:
space:
mode:
authorXiao Pan <gky44px1999@gmail.com>2024-06-08 22:29:06 -0700
committerXiao Pan <gky44px1999@gmail.com>2024-06-08 22:29:06 -0700
commit561777b7e71d278485e200752350dea6c92b0089 (patch)
treea8c28486b61164bc0dcfae506699ca1d29b227eb
parent71c276d1225bf9909b5e6d15e2437cb6d7d06a56 (diff)
archive another dynotify in sh instead C
-rwxr-xr-xsh/dynotify_sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/sh/dynotify_sh b/sh/dynotify_sh
new file mode 100755
index 0000000..16988b1
--- /dev/null
+++ b/sh/dynotify_sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+up=
+while :; do
+	if [ "$(curl -s https://www.douyu.com/betard/"$1" | jq '.room.show_status')" -eq 1 ]; then
+		if ! [ "$up" ]; then
+			notify-send "$2开播"
+			up=1
+		fi
+	else
+		[ "$up" ] && up=
+	fi
+	sleep 60
+done