A simple clonk server
(Install Python)
pip install -r requirements.txt
python clonker.py [ -d ] [ -m <dist> ] [ -t <time> ] run
-d
- enable debug to stdout-m
- use<dist>
(meters) for "close enough" limit-t
- use<time>
(seconds) for "close enough" time window
- POST to
<server>/clonk
{
"version": "1.0.0",
"id": "my name or id",
"latitude": 40.000000,
"longitude": -40.00000,
"altitude": 0.5,
"some other data": "banana"
}
version
represents the client protocol version and must be1.0.0
- JSON Body must contain an
id
key. This is used to distinguish clients. - JSON Body MAY contain any/all keys
latitude
,longitude
,altitude
- latitude and longitude are in degrees
- altitude is meters. Altitude can be provided by both or neither events. If it's provided by only one, it will not report a clonk.
- JSON Body may contain other keys. They will be sent to clonk-mates.
- After the window, you'll get back a list (JSON) of the client clonks for clients (clonk-mates) who also clonked (with you) within the window.
version
in response represents server version. Currently 1.0.0
.
{
"version": "1.0.0",
"clonks": [
{
"id": "client 1",
"latitude": 40.000002,
"longitude": -40.0,
"altitude": 0.5,
"at": 1701545253.113344,
"some other data": "banana"
},
{
"id": "client 2",
"latitude": 40.000001,
"longitude": -40.0,
"altitude": 1.5,
"at": 1701545255.066371,
"some other data": "raspberry"
}
]
}
- You will not be in the list.
Requests within a given distance and time window
Why not make this 0.0? Potentially different latencies in opening a connnection to the server. Times are recorded by the server, not reported by the client so skew is not an issue
Why not make this 0.0? Inaccuracies in phone position. Locations are fuzzy.
(connection and network latency, and a bit of server latency)
See License