Savoir si une chaîne twitch est en ligne - retour accueil
git clone git://bebou.netlib.re/twitch-online
Log | Files | Refs | README |
commit d37d1c7a0d84b94e56723dcf3ccacb9e0a40df0d parent bc293a56381d16ae580532e3c833bacc84ecb438 Auterice: arthur <arthur.pons@unistra.fr> Date: Sat, 5 Mar 2022 13:47:47 +0100 Use twitchtracker instead cuz web page is smaller Diffstat:
M | twitch_update | | | 30 | +++++++++++++++++++++++------- |
1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/twitch_update b/twitch_update @@ -3,14 +3,30 @@ rm -f ~/.sfeed/feeds/twitch make_feed() { + echo -n "live" echo "$(date +'%s') https://twitch.tv/$1 $1" >> ~/.sfeed/feeds/twitch } -curl -sL sullygnome.com/channel/esl_sc2 | grep -q "Online now" && make_feed esl_sc2 -curl -sL sullygnome.com/channel/pousour | grep -q "Online now" && make_feed pousour -curl -sL sullygnome.com/channel/tfue | grep -q "Online now" && make_feed tfue -curl -sL sullygnome.com/channel/diegosaurs | grep -q "Online now" && make_feed diegosaurs -curl -sL sullygnome.com/channel/esl_csgo | grep -q "Online now" && make_feed esl_csgo -curl -sL sullygnome.com/channel/blastpremier | grep -q "Online now" && make_feed blastpremier -curl -sL sullygnome.com/channel/sweetdreams | grep -q "Online now" && make_feed sweetdreams +check_live() { + echo -n "$1 status : " + curl -sL https://twitchtracker.com/search?q=$1 | grep -A1 "<a href=\"/$1\" class=\"item-title\">" | grep -q "twitch-live-circle" && make_feed $1 + echo "" + # Otherwise twitchtracker.com overloads + sleep 2 +} + +check_live esl_sc2 +check_live shivfps +check_live shivfps +check_live shivfps +check_live shivfps +check_live shivfps +check_live pousour +check_live tfue +check_live diegosaurs +check_live esl_csgo +check_live blastpremier +check_live sweetdreams +check_live rogue +check_live daltoosh exit 0