Last active
December 29, 2021 22:13
-
-
Save GladOSkar/6964e6b55fa281a72090a1fce5895ae1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
while true | |
do | |
DAYOFMONTH=`date +"%d"` | |
DAYOFEVENT=`expr $DAYOFMONTH - 27` # adjusts for 0-indexing of array | |
echo -n "Reloading schedule... " | |
curl https://static.rc3.world/schedule/everything.json | jq ".schedule.conference.days[$DAYOFEVENT].rooms | {\"Chaosstudio Hamburg\", \"FeM Channel\", \"Haecksen Stream\", \"r3s - Monheim/Rhein\", \"Chaos-West TV\", \"ChaosZone TV\", \"Lichtung\", \"about:future stage\"}" > current.json | |
echo -n "comparing... " | |
diff old.json current.json | grep 'guid\|date\|start\|duration\|room\|title' > poll.diff | |
FSIZE=`stat --printf="%s" poll.diff` | |
if [ $FSIZE -gt 1 ] | |
then | |
notify-send "FAHRPLAN UPDATE!" | |
cp poll.diff `date -Iseconds`.diff | |
fi | |
mv current.json old.json | |
echo "done" | |
sleep 300 # 5 minutes | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment