From f93eb11c24411d713d738b9aec7022d56b80c34a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 12 Mar 2022 23:10:16 -0500 Subject: [PATCH] parse json --- groundstation/tago-upload.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/groundstation/tago-upload.py b/groundstation/tago-upload.py index 44300c0f..dbcea6f0 100644 --- a/groundstation/tago-upload.py +++ b/groundstation/tago-upload.py @@ -1,5 +1,6 @@ import tago import requests +import json while (True): @@ -7,9 +8,13 @@ while (True): # telem_string = input() - telem_string = requests.get('https://api.aprs.fi/api/get?name=W3YP-11&what=loc&apikey=APIKEY&format=json') + telem_json = requests.get('https://api.aprs.fi/api/get?name=W3YP-11&what=loc&apikey=APIKEY&format=json') - print(telem_string.text) + telem_parsed = json.loads(telem_json) + + telem_string = telem_parsed["comment"] + + print(telem_string) chunks = telem_string.text.split(' ')