Beispiel #1
0
def get_user_id(nickname):
    result = json.loads(plurk.callAPI('/Profile/getPublicProfile',
        user_id=nickname).read())
    if 'user_info' in result.keys():
        return result['user_info']['uid']
    else:
        return False
Beispiel #2
0
def get_user_id(nickname):
    result = json.loads(
        plurk.callAPI('/Profile/getPublicProfile', user_id=nickname).read())
    if 'user_info' in result.keys():
        return result['user_info']['uid']
    else:
        return False
Beispiel #3
0
def are_friends(userA, userB):
    url = '/FriendsFans/getFriendsByOffset'
    uid_A = get_user_id(userA)
    uid_B = get_user_id(userB)
    if uid_A and uid_B:
        friends = json.loads(plurk.callAPI(url,user_id=uid_A,limit=5000).read())
    else:
        return False
    for friend in friends:
        if uid_B == friend['uid']:
            return True
    return False
Beispiel #4
0
def are_friends(userA, userB):
    url = '/FriendsFans/getFriendsByOffset'
    uid_A = get_user_id(userA)
    uid_B = get_user_id(userB)
    if uid_A and uid_B:
        friends = json.loads(
            plurk.callAPI(url, user_id=uid_A, limit=5000).read())
    else:
        return False
    for friend in friends:
        if uid_B == friend['uid']:
            return True
    return False