コード例 #1
0
ファイル: run.py プロジェクト: dswelbor/social-consumer
print('Aggregating \'high comment count\' posts...')
hi_comment_posts = social_consumer.get_hi_comment_submissions()

print('Aggregating \'most upvoted\' posts...')
upvoted_posts = social_consumer.get_upvoted_submissions()

print('Aggregating \'unique\' subreddits...')
unique_forums = social_consumer.get_unique_subreddits()

print('Aggregating \'recurring\' subreddits...')
recurring_forums = social_consumer.get_recurring_subreddits()

# Create multireddit of recurring subreddits
print('Creating multireddit with recurring subreddits...\n')
multireddit_result = social_consumer.create_multireddit()

# Print collection lengths
print(f'Number of Original Content Posts {len(oc_posts)}')
print(f'Number of Posts with High Comment Counts: {len(hi_comment_posts)}')
print(
    f'Number of top 10 most upvoted posts (descending): {len(upvoted_posts)}')
# print top most upvoted posts
for post in upvoted_posts:
    print(f'\tTitle: {post.title[:50]}')
    print(f'\tUpvotes: {post.upvotes}')
print(f'Number of "unique" subreddits in r/popular: {len(unique_forums)}')
print(f'Number of recurring subreddits in r/popular: {len(recurring_forums)}')
print(f'Multireddit: {multireddit_result}\n')

# Export data as json