sondehub-infra/lambda/query_ham/__main__.py

24 lines
639 B
Python
Raw Normal View History

2022-02-26 23:55:34 +00:00
from . import *
import base64
import zlib
2022-11-04 10:24:52 +00:00
response = get_telem(
2022-02-26 23:55:34 +00:00
{
2022-05-11 03:34:57 +00:00
"pathParameters": {
2022-11-04 10:24:52 +00:00
2022-05-11 03:34:57 +00:00
},
2022-02-26 23:55:34 +00:00
"queryStringParameters":{
2022-11-04 10:24:52 +00:00
"payload_callsign" : "NOB14,VE6AGD-11",
2022-07-02 07:06:13 +00:00
"last": "10800",
"datetime": "2022-06-26T08:30:00.000001Z",
"format": "kml"
2022-02-26 23:55:34 +00:00
}
}, {})
2022-05-11 03:34:57 +00:00
print(len(response['body']))
2022-02-26 23:55:34 +00:00
compressed = base64.b64decode(response['body'])
decompressed = (zlib.decompress(compressed, 16 + zlib.MAX_WBITS))
2022-05-11 03:34:57 +00:00
#print(json.loads(decompressed))
2022-07-02 07:06:13 +00:00
#print(decompressed.decode().splitlines()[:5])
print(decompressed.decode())