Ich habe es basierend auf Create HTTP Get Box erstellt.
Die API ist diese Wetter-API. http://weather.livedoor.com/forecast/webservice/json/v1?city=200010
class MyClass(GeneratedClass):
def __init__(self):
GeneratedClass.__init__(self)
def onLoad(self):
#put initialization code here
pass
def onUnload(self):
#put clean-up code here
pass
def onInput_onStart(self, url):
import urllib2, json
api = "http://weather.livedoor.com/forecast/webservice/json/v1?city=200010"
r = urllib2.urlopen(api)
root = json.loads(r.read())
self.onStopped(root['title'].encode('utf8'))
Recommended Posts