- Code: Select all
#! /usr/bin/env python2.5
# -*- coding: utf-8 -*-
import simplejson
import urllib2
DTVIP = "192.168.1.28"
url = "http://%s:8080/tv/getTuned?" % DTVIP
f = urllib2.urlopen(url)
simplejson_string = f.read()
f.close()
parsed_simplejson = simplejson.loads(simplejson_string)
try:
programTitle = parsed_simplejson['title']
indigo.variable.updateValue(1708209973, programTitle)
except:
indigo.variable.updateValue(1708209973, " ")
try:
majorCh = parsed_simplejson['major']
indigo.variable.updateValue(564695813, majorCh)
except:
indigo.variable.updateValue(564695813, " ")
The return is always blank, or whatever I may type into the "except".
callsign and a few others will work but not major.
What's odd is that they all log just fine using your original script.
Thanks,
Carl