added refresh script
This commit is contained in:
parent
d3f74c17db
commit
c4101f86cc
|
@ -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
|
- 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
|
- 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
|
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
|
## using
|
||||||
- use you favourite http client or web browser and point it to
|
- 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
|
top of the script
|
||||||
- to modify rate limiting behavior, you can also modify those variables at the
|
- to modify rate limiting behavior, you can also modify those variables at the
|
||||||
top of the script as well
|
top of the script as well
|
||||||
|
- the rate limit is for the script, and prevents too much refreshing of the
|
||||||
|
browser page
|
||||||
|
|
||||||
## why?
|
## why?
|
||||||
- its really hard to scrape hltv live scores any other way
|
- its really hard to scrape hltv live scores any other way
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue