Esempio n. 1
0
 def user(self, **kw):
     key = util.make_key('user_twitter', kw)
     data = util.get_cache_data(key)
     if data:
         print 'YES'
         return data
     
     ID = kw['ID'] if kw.has_key('ID') else ''
     res = self.api.users__show(screen_name = ID)
     logging.info(str(res))
     
     response = self.parse_user(res)
     util.set_cache_data(key, response)
     return response
Esempio n. 2
0
    def user(self, **kw):
        key = util.make_key('user_twitter', kw)
        data = util.get_cache_data(key)
        if data:
            print 'YES'
            return data

        ID = kw['ID'] if kw.has_key('ID') else ''
        res = self.api.users__show(screen_name=ID)
        logging.info(str(res))

        response = self.parse_user(res)
        util.set_cache_data(key, response)
        return response
Esempio n. 3
0
 def user(self, **kw):
     key = util.make_key('user_sina',kw)
     data = util.get_cache_data(key)
     if data:
         return data
     
     ID = kw['ID'] if 'ID' in kw else ''
     screen_name = kw['screen_name'] if 'screen_name' in kw else ''
     if ID:
         res = self.api.users__show(uid = ID)
     elif screen_name:
         res = self.api.users__show(screen_name = screen_name)
     
     response = self.parse_user(res)
     util.set_cache_data(key, response)
     return response
Esempio n. 4
0
    def user(self, **kw):
        key = util.make_key('user_sina', kw)
        data = util.get_cache_data(key)
        if data:
            return data

        ID = kw['ID'] if 'ID' in kw else ''
        screen_name = kw['screen_name'] if 'screen_name' in kw else ''
        if ID:
            res = self.api.users__show(uid=ID)
        elif screen_name:
            res = self.api.users__show(screen_name=screen_name)

        response = self.parse_user(res)
        util.set_cache_data(key, response)
        return response