about summary refs log tree commit diff
path: root/sh/dynotify_sh
blob: 16988b10ba57e188b5e3a7451c2b97a0c7187e20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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