コード例 #1
0
def print_page_list():
    for p in pages.find():
        print("ID - {id}, name - {name}, fans - {fan_count}".format(**p))
コード例 #2
0
def get_page_list():
    return list(pages.find())
コード例 #3
0
def get_best_posts_per_page(limit=3):
    pages_with_best_posts = dict()
    for page in pages.find():
        pages_with_best_posts[page['id']] = get_posts_ordered_by_score(
            page['id'], limit)
    return pages_with_best_posts
コード例 #4
0
def update_posts_per_page(post_limit=300):
    with futures.ThreadPoolExecutor(max_workers=10) as executor:
        for page in pages.find():
            executor.submit(async_posts_update, page, post_limit)

    print("Done")
コード例 #5
0
def get_best_posts_per_page(limit=3):
    pages_with_best_posts = dict()
    for page in pages.find():
        pages_with_best_posts[page['id']] = get_posts_ordered_by_score(page['id'], limit)
    return pages_with_best_posts
コード例 #6
0
def update_posts_per_page(post_limit=300):
    with futures.ThreadPoolExecutor(max_workers=10) as executor:
        for page in pages.find():
            executor.submit(async_posts_update, page, post_limit)

    print("Done")