def urlget(self, url):
     res = urlopen(url, timeout=60)
     if res.code == 200:
         doc = res.read()
         doc = json.loads(doc)
         return doc['response']
     return ''
Beispiel #2
0
 def fetch(self, url):
     res = urlopen(url, timeout=60)
     if res.code == 200:
         return res.read()
     return ""