Exemple #1
0
def ajax_attention():
    uid = request.args.get("uid", "")
    uid = str(uid)
    results = search_attention(uid)
    if results:
        return json.dumps(results)
    else:
        return None
def ajax_attention():
    uid = request.args.get('uid', '')
    top_count = request.args.get('top_count', SOCIAL_DEFAULT_COUNT)
    uid = str(uid)
    top_count = int(top_count)
    results = search_attention(uid, top_count)
    if not results:
        results = {}
    return json.dumps(results)
Exemple #3
0
def ajax_attention():
    uid = request.args.get('uid', '')
    top_count = request.args.get('top_count', SOCIAL_DEFAULT_COUNT)
    uid = str(uid)
    top_count = int(top_count)
    results = search_attention(uid, top_count)
    if not results:
        results = {}
    return json.dumps(results)
def ajax_attention():
    uid = request.args.get('uid', '')
    top_count = request.args.get('top_count', SOCIAL_DEFAULT_COUNT)
    sensitive = request.args.get('sensitive', 0)
    uid = str(uid)
    top_count = int(top_count)
    if int(sensitive) == 0:
        results = search_attention(uid, top_count)
    else:
        results = sensitive_search_attention(uid, top_count)
    if not results:
        results = {}
    return json.dumps(results)
Exemple #5
0
def ajax_attention():
    uid = request.args.get('uid', '')
    top_count = request.args.get('top_count', SOCIAL_DEFAULT_COUNT)
    sensitive = request.args.get('sensitive', 0)
    uid = str(uid)
    top_count = int(top_count)
    if int(sensitive) == 0:
        results = search_attention(uid, top_count)
    else:
        results = sensitive_search_attention(uid, top_count)
    if not results:
        results = {}
    return json.dumps(results)
Exemple #6
0
def find_friends(uids):

    friends_list = dict()
    for uid in uids:
        #v = search_follower(uid)
        v_items = search_attention(uid)
        v = v_items[0]
        item = []
        if not v:
            friends_list[str(uid)] = []
            continue
        for i in v.keys():
            item.append(i)
        friends_list[str(uid)] = item

    return friends_list