Ejemplo n.º 1
0
def acquire_user_by_id(uid):
    XAPIAN_USER_DATA_PATH = "/home/xapian/xapian_user/"
    user_search = XapianSearch(path=XAPIAN_USER_DATA_PATH, name="master_timeline_user", schema_version=1)
    result = user_search.search_by_id(int(uid), fields=["name", "location", "followers_count", "friends_count"])
    user = {}
    if result:
        user["name"] = result["name"]
        user["location"] = result["location"]
        user["count1"] = result["followers_count"]
        user["count2"] = result["friends_count"]

    return user
Ejemplo n.º 2
0
def acquire_user_by_id(uid):
    user_search = XapianSearch(path=XAPIAN_USER_DATA_PATH, name='master_timeline_user', schema_version=1)
    result = user_search.search_by_id(int(uid), fields=['name', 'location', 'followers_count', 'friends_count', 'profile_image_url'])
    user = {}

    if result:
        user['name'] = result['name']
        user['location'] = result['location']
        user['followers_count'] = result['followers_count']
        user['friends_count'] = result['friends_count']
        user['profile_image_url'] = result['profile_image_url']
    else:
        return None

    return user
Ejemplo n.º 3
0
def acquire_user_by_id(uid):
    XAPIAN_USER_DATA_PATH = '/home/xapian/xapian_user/'
    user_search = XapianSearch(path=XAPIAN_USER_DATA_PATH,
                               name='master_timeline_user',
                               schema_version=1)
    result = user_search.search_by_id(
        int(uid),
        fields=['name', 'location', 'followers_count', 'friends_count'])
    user = {}
    if result:
        user['name'] = result['name']
        user['location'] = result['location']
        user['count1'] = result['followers_count']
        user['count2'] = result['friends_count']

    return user
Ejemplo n.º 4
0
def acquire_user_by_id(uid):
    user_search = XapianSearch(path=XAPIAN_USER_DATA_PATH,
                               name='master_timeline_user',
                               schema_version=1)
    result = user_search.search_by_id(int(uid),
                                      fields=[
                                          'name', 'location',
                                          'followers_count', 'friends_count',
                                          'profile_image_url'
                                      ])
    user = {}

    if result:
        user['name'] = result['name']
        user['location'] = result['location']
        user['followers_count'] = result['followers_count']
        user['friends_count'] = result['friends_count']
        user['profile_image_url'] = result['profile_image_url']
    else:
        return None

    return user