コード例 #1
0
ファイル: okutils.py プロジェクト: Cheater-84/ZOMBIE-FARMER
    def _getUserInfo(self):
        post = {
            'uids': self._params['logged_user_id'],
            'new_sig': 1,
            'session_key': self._params['session_key'],
            'fields':
            u'uid,first_name,last_name,gender,birthday,locale,location',
            'application_key': self._params['application_key'],
            'format': 'Json'
        }
        post_keys = sorted(post.keys())
        param_str = "".join([
            "%s=%s" % (str(key), api._encode(post[key])) for key in post_keys
        ])
        param_str += self._params['session_secret_key']
        sign = md5(param_str).hexdigest().lower()
        post.update({'sig': sign})
        info = requests.post('http://api.ok.ru/api/users/getInfo',
                             data=post).json()[0]

        game_info = GameInfo(city=info['location']['city'],
                             first_name=info['first_name'],
                             last_name=info['last_name'],
                             uid=long(info['uid']),
                             country=info['location']['country'],
                             bdate=info['birthday'])
        global uid
        uid = info['uid']
        return game_info
コード例 #2
0
ファイル: okutils.py プロジェクト: Cheater-84/ZOMBIE-FARMER
    def _get_friends_list(self):
        post = {
            'new_sig': 1,
            'session_key': self._params['session_key'],
            'application_key': self._params['application_key'],
            'format': 'Json'
        }
        post_keys = sorted(post.keys())
        param_str = "".join(["%s=%s" % (str(key), api._encode(post[key])) for key in post_keys])
        param_str += self._params['session_secret_key']
        sign = md5(param_str).hexdigest().lower()
        post.update({'sig': sign})
        info = requests.post('http://api.ok.ru/api/friends/getAppUsers', data=post).json()['uids']

        return info
コード例 #3
0
ファイル: okutils.py プロジェクト: Cheater-84/ZOMBIE-FARMER
 def _get_friend_info(self, friend):
     post = {
         'uids': friend,
         'new_sig': 1,
         'session_key': self._params['session_key'],
         'fields': u'uid,first_name,last_name,gender,birthday,locale,location',
         'application_key': self._params['application_key'],
         'format': 'Json'
     }
     post_keys = sorted(post.keys())
     param_str = "".join(["%s=%s" % (str(key), api._encode(post[key])) for key in post_keys])
     param_str += self._params['session_secret_key']
     sign = md5(param_str).hexdigest().lower()
     post.update({'sig': sign})
     info = requests.post('http://api.ok.ru/api/users/getInfo', data=post).json()[0]
     print info
コード例 #4
0
ファイル: okutils.py プロジェクト: Cheater-84/ZOMBIE-FARMER
    def _get_friends_list(self):
        post = {
            'new_sig': 1,
            'session_key': self._params['session_key'],
            'application_key': self._params['application_key'],
            'format': 'Json'
        }
        post_keys = sorted(post.keys())
        param_str = "".join([
            "%s=%s" % (str(key), api._encode(post[key])) for key in post_keys
        ])
        param_str += self._params['session_secret_key']
        sign = md5(param_str).hexdigest().lower()
        post.update({'sig': sign})
        info = requests.post('http://api.ok.ru/api/friends/getAppUsers',
                             data=post).json()['uids']

        return info
コード例 #5
0
ファイル: okutils.py プロジェクト: Cheater-84/ZOMBIE-FARMER
 def _get_friend_info(self, friend):
     post = {
         'uids': friend,
         'new_sig': 1,
         'session_key': self._params['session_key'],
         'fields':
         u'uid,first_name,last_name,gender,birthday,locale,location',
         'application_key': self._params['application_key'],
         'format': 'Json'
     }
     post_keys = sorted(post.keys())
     param_str = "".join([
         "%s=%s" % (str(key), api._encode(post[key])) for key in post_keys
     ])
     param_str += self._params['session_secret_key']
     sign = md5(param_str).hexdigest().lower()
     post.update({'sig': sign})
     info = requests.post('http://api.ok.ru/api/users/getInfo',
                          data=post).json()[0]
     print info
コード例 #6
0
ファイル: okutils.py プロジェクト: Cheater-84/ZOMBIE-FARMER
    def _getUserInfo(self):
        post = {
            'uids': self._params['logged_user_id'],
            'new_sig': 1,
            'session_key': self._params['session_key'],
            'fields': u'uid,first_name,last_name,gender,birthday,locale,location',
            'application_key': self._params['application_key'],
            'format': 'Json'
        }
        post_keys = sorted(post.keys())
        param_str = "".join(["%s=%s" % (str(key), api._encode(post[key])) for key in post_keys])
        param_str += self._params['session_secret_key']
        sign = md5(param_str).hexdigest().lower()
        post.update({'sig': sign})
        info = requests.post('http://api.ok.ru/api/users/getInfo', data=post).json()[0]

        game_info = GameInfo(city=info['location']['city'], first_name=info['first_name'], last_name=info['last_name'],
                             uid=long(info['uid']), country=info['location']['country'], bdate=info['birthday'])
        global uid
        uid = info['uid']
        return game_info