Add main mechanism for checking tildes

This commit is contained in:
Robert Miles 2018-11-10 15:38:48 -05:00
parent 3bb16ac463
commit eb3116b3b7
3 changed files with 24 additions and 0 deletions

6
config.json.example Normal file
View File

@ -0,0 +1,6 @@
{
"tildes": [
"example.com",
"example.net"
]
}

1
status.json Normal file
View File

@ -0,0 +1 @@
{"tildes":{"tilde.team":{"ssh":true,"web":true,"gopher":true,"alive":true}}}

17
update.py Normal file
View File

@ -0,0 +1,17 @@
import check, json, time
CONFIG = {"tildes":[]}
try:
with open("config.json") as f:
CONFIG = json.load(f)
except:
pass
tildes = dict()
for tilde in CONFIG["tildes"]:
tildes[tilde] = check.checkTilde(tilde)
with open("status.json","w") as f:
json.dump(dict(tildes=tildes),f)