added refresh script

This commit is contained in:
sose 2021-04-06 19:08:58 +00:00
parent d3f74c17db
commit c4101f86cc
2 changed files with 18 additions and 0 deletions

View File

@ -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

12
refresh.sh Executable file
View File

@ -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