mirror of https://github.com/dirtbags/moth.git
Add time field to GetState
This commit is contained in:
parent
43141a38f4
commit
20a6f92173
|
@ -85,6 +85,7 @@ None
|
||||||
* teams: mapping from anonymized team ID to team name
|
* teams: mapping from anonymized team ID to team name
|
||||||
* log: list of (timestamp, team number, category, points)
|
* log: list of (timestamp, team number, category, points)
|
||||||
* notices: list of HTML broadcast notices to display to the user
|
* notices: list of HTML broadcast notices to display to the user
|
||||||
|
* now: current server time (unix epoch)
|
||||||
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
@ -111,7 +112,8 @@ None
|
||||||
"notices": [
|
"notices": [
|
||||||
"<a href=\"https://appspot.com/dooted-bagel-8372/entry\">WOPR category</a> is now open",
|
"<a href=\"https://appspot.com/dooted-bagel-8372/entry\">WOPR category</a> is now open",
|
||||||
"Event closes at 18:00 today, and will resume tomorrow at 08:00"
|
"Event closes at 18:00 today, and will resume tomorrow at 08:00"
|
||||||
]
|
],
|
||||||
|
"now": 1527170088
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#! /usr/bin/python3
|
#! /usr/bin/python3
|
||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
|
import time
|
||||||
|
|
||||||
async def fake_register(request):
|
async def fake_register(request):
|
||||||
teamId = request.query.get("teamId")
|
teamId = request.query.get("teamId")
|
||||||
|
@ -44,6 +45,7 @@ async def fake_state(request):
|
||||||
"<a href=\"https://appspot.com/dooted-bagel-8372/entry\">WOPR category</a> is now open",
|
"<a href=\"https://appspot.com/dooted-bagel-8372/entry\">WOPR category</a> is now open",
|
||||||
"Event closes at 18:00 today, and will resume tomorrow at 08:00"
|
"Event closes at 18:00 today, and will resume tomorrow at 08:00"
|
||||||
],
|
],
|
||||||
|
"now": int(time.time()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return web.json_response(resp)
|
return web.json_response(resp)
|
||||||
|
|
Loading…
Reference in New Issue