From c4101f86cccd67ba1c1383542881f25a6ab2d84b Mon Sep 17 00:00:00 2001 From: sose Date: Tue, 6 Apr 2021 19:08:58 +0000 Subject: [PATCH] added refresh script --- readme.md | 6 ++++++ refresh.sh | 12 ++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 refresh.sh diff --git a/readme.md b/readme.md index e057d41..a8ad05d 100644 --- a/readme.md +++ b/readme.md @@ -27,6 +27,10 @@ a script to get live scores from hltv.org - the server will serve live game data in JSON format on localhost port 8000 - not too sure about node's http server security, you might want to use a reverse proxy if you're exposing it to the web +- if you don't want to manually refresh the browser page there is the + `refresh.sh` script in this repo that will do it for you + - scores are automatically updated, but this is necessary to get new + matches ## using - use you favourite http client or web browser and point it to @@ -43,6 +47,8 @@ a script to get live scores from hltv.org top of the script - to modify rate limiting behavior, you can also modify those variables at the top of the script as well + - the rate limit is for the script, and prevents too much refreshing of the + browser page ## why? - its really hard to scrape hltv live scores any other way diff --git a/refresh.sh b/refresh.sh new file mode 100755 index 0000000..b3f38b8 --- /dev/null +++ b/refresh.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# this script reloads the electron page every $interval to make sure all the +# matches are fresh + +interval=18000 # 5 minutes + +while true +do + curl -s "https://illegaldrugs.net/skor?reload" >/dev/null + echo "reloaded on $(date)" + sleep $interval +done