示例#1
0
# Instantiate a Consumer object to consume data from reddit api
social_consumer = Consumer()

# Get lists of posts
print('Aggregating \'original content\' posts...')
oc_posts = social_consumer.get_oc_submissions()

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: