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