def api_renren_verify(key, secret, oauth_id):
    res = api_network_http(
        *api_renren(key, secret, {'method': 'users.getInfo'}))
    if json.loads(res):
        m = json.loads(res)
        if isinstance(m, dict) and m.get('error_code'):
            oauth_rm_by_oauth_id(oauth_id)
        else:
            return True
def api_sina_verify(key, secret, oauth_id):
    res = api_network_http(*api_sina(
        '/users/show.json', {'user_id': SINA_FOLLOW}, key, secret, 'GET'))
    if json.loads(res):
        m = json.loads(res)
        if int(m.get('error_code', '0')) == 401:
            oauth_rm_by_oauth_id(oauth_id)
        else:
            return True
Exemple #3
0
def api_renren_verify(key, secret, oauth_id):
    res = api_network_http(*api_renren(
        key,
        secret,
        {'method':'users.getInfo'}
        ))
    if json.loads(res):
        m = json.loads(res)
        if isinstance(m, dict) and m.get('error_code'):
            oauth_rm_by_oauth_id(oauth_id)
        else:
            return True
Exemple #4
0
def api_douban_verify(key, secret, oauth_id):
    res = api_network_http(*api_douban(
            '/people/@me',
            {},
            key,
            secret,
            'GET'
            ))
    if res.startswith('Signature does not match'):
        oauth_rm_by_oauth_id(oauth_id)
    else:
        return True
def api_www163_verify(key, secret, oauth_id):
    res = api_network_http(*api_www163(
        '/users/show.json',
        {},
        key,
        secret,
        'GET',
    ))
    if json.loads(res):
        m = json.loads(res)
        if int(m.get('error_code', '0')) == 401:
            oauth_rm_by_oauth_id(oauth_id)
        else:
            return True
def api_qq_verify(key, secret, oauth_id):
    res = api_network_http(*api_qq(
        '/api/user/info',
        {},
        key,
        secret,
        'GET',
    ))
    if json.loads(res):
        m = json.loads(res)
        if int(m.get('errcode', '0')) == 9:
            oauth_rm_by_oauth_id(oauth_id)
        else:
            return True
Exemple #7
0
def api_www163_verify(key, secret, oauth_id):
    res = api_network_http(*api_www163(
            '/users/show.json',
            {},
            key,
            secret,
            'GET',
            ))
    if json.loads(res):
        m = json.loads(res)
        if int(m.get('error_code', '0')) == 401:
            oauth_rm_by_oauth_id(oauth_id)
        else:
            return True
Exemple #8
0
def api_qq_verify(key, secret, oauth_id):
    res = api_network_http(*api_qq(
            '/api/user/info',
            {},
            key,
            secret,
            'GET',
            ))
    if json.loads(res):
        m = json.loads(res)
        if int(m.get('errcode', '0')) == 9:
            oauth_rm_by_oauth_id(oauth_id)
        else:
            return True
Exemple #9
0
def api_sina_verify(key, secret, oauth_id):
    res = api_network_http(*api_sina(
            '/users/show.json',
            {'user_id':SINA_FOLLOW},
            key,
            secret,
            'GET'
            ))
    if json.loads(res):
        m = json.loads(res)
        if int(m.get('error_code', '0')) == 401:
            oauth_rm_by_oauth_id(oauth_id)
        else:
            return True
def api_douban_verify(key, secret, oauth_id):
    res = api_network_http(*api_douban('/people/@me', {}, key, secret, 'GET'))
    if res.startswith('Signature does not match'):
        oauth_rm_by_oauth_id(oauth_id)
    else:
        return True