by JirkaV

New About Yours API Help
643 bytes, Python 3
import json
import urllib.request

URL = 'http://gsx2json.com/api?id=1QiWejssChzd4LeNPv440nxskpMYXkNP3F7Ron5BJooE&sheet=4&columns=false'

with urllib.request.urlopen(URL) as response:
   json_data = response.read()

# json_data:  "b{'rows': [{'vlhkost': 30.54, 'svetlo': 22, 'teplota': 32.63}]}"

# konverze dat z binarni podoby do retezce a pak prevod JSON na Python objekt
data = json.loads(str(json_data, encoding='ascii'))
# data: {'rows': [{'vlhkost': 30.54, 'svetlo': 22, 'teplota': 32.63}]}
mereni = data['rows'][0]  # odstraneni nepotrebnych vnejsich "vrstev"
# mereni: {'vlhkost': 30.54, 'svetlo': 22, 'teplota': 32.63}
print(mereni)
Pasted 5 months, 1 week ago — Expires in 203 days
URL: http://dpaste.com/1254J3Y