Exemple #1
0
def show_following(user) -> dict:
    verify_user_exists(user)
    return dict(
        users = pubsub.get_followed(user),
        who_does_what = f'Who {user} is following',
        comb = comb,
    )
Exemple #2
0
    pprint(dict(followers))

    print('\nFollowing')
    pprint(dict(following))

    print("\nUser info")
    pprint(user_info)

    print('-' * 50)

    print('\nPosts by felix (3)')
    pprint(posts_by_user('felix', limit=3))

    print('\nPosts for homer (6)')
    pprint(posts_for_user('homer', limit=6))

    print('\nSearch for #python (4)')
    pprint(search('#python', limit=4))

    print("\nFelix 's followers")
    pprint(get_followers('felix'))

    print("\nHomer follows")
    pprint(get_followed('homer'))

    print("\nPopeye's info")
    print(get_user('popeye'))

    print("\nPost ages")
    pprint(list(map(age, posts)))
Exemple #3
0
    from pubsub import posts_by_user, posts_for_user, search
    from pubsub import get_followers, get_followed, get_user, check_user, age

    assert check_user('raymondh', password='******')
    assert not check_user('davin', password='******')

    print()
    pprint(list(posts))
    print('\nFollowers')
    pprint(dict(followers))
    print('\nFollowing')
    pprint(dict(following))
    print("\nUser info")
    pprint(user_info)
    print('-' * 50)

    print('\nPosts by raymondh (3)')
    pprint(posts_by_user('raymondh', limit=3))
    print('\nPosts for davin (6)')
    pprint(posts_for_user('davin', limit=6))
    print('\nSearch for #python (4)')
    pprint(search('#python', limit=4))
    print("\nRaymond's followers")
    pprint(get_followers('raymondh'))
    print("\nDavin follows")
    pprint(get_followed('davin'))
    print("\nBarry's info")
    print(get_user('barry'))
    print("\nPost ages")
    pprint(list(map(age, posts)))
Exemple #4
0
    assert not check_user('davin', password='******')

    print()
    pprint(list(posts))
    print('\nFollowers')
    pprint(dict(followers))
    print('\nFollowing')
    pprint(dict(following))
    print("\nUser info")
    pprint(user_info)
    print('-' * 50)

    print('\nPosts by raymondh (3)')
    pprint(posts_by_user('raymondh', limit=3))
    print('\nPosts for davin (6)')
    pprint(posts_for_user('davin', limit=6))
    print('\nSearch for #python (4)')
    pprint(search('#python', limit=4))
    print('\nSearch for python (4)')
    pprint(search('python', limit=4))
    print("\nRaymond's followers")
    pprint(get_followers('raymondh'))
    print("\nDavin follows")
    pprint(get_followed('davin'))
    print("\nBarry's info")
    print(get_user('barry'))
    print("\nPost ages")
    pprint(list(map(age, posts)))
    print('\nHash tag index:')
    pprint(hashtag_index)
Exemple #5
0
    assert not check_user("davin", password="******")

    print()
    pprint(list(posts))
    print("\nFollowers")
    pprint(dict(followers))
    print("\nFollowing")
    pprint(dict(following))
    print("\nUser info")
    pprint(user_info)
    print("-" * 50)

    print("\nPosts by raymondh (3)")
    pprint(posts_by_user("raymondh", limit=3))
    print("\nPosts for davin (6)")
    pprint(posts_for_user("davin", limit=6))
    print("\nSearch for #python (4)")
    pprint(search("#python", limit=4))
    print("\nSearch for python (4)")
    pprint(search("python", limit=4))
    print("\nRaymond's followers")
    pprint(get_followers("raymondh"))
    print("\nDavin follows")
    pprint(get_followed("davin"))
    print("\nBarry's info")
    print(get_user("barry"))
    print("\nPost ages")
    pprint(list(map(age, posts)))
    print("\nHash tag index:")
    pprint(hashtag_index)