Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- """
- Created on Tue Mar 28 19:11:11 2017
- @author: Jumbify
- """
- import random
- import praw
- num_of_winners = 8
- reddit = praw.Reddit(user_agent='Comment Extraction (by /u/jumbify)',
- client_id='', client_secret="",
- username='', password='')
- submission = reddit.submission(url='')
- submission.comments.replace_more(limit=None, threshold=0)
- usernames = []
- for top_comments in submission.comments:
- usernames.append(top_comments.author)
- usernames = list(set(usernames))
- print("Number of entries: " + str(len(usernames)))
- for i in range(0,num_of_winners):
- random_number = random.randint(1,len(usernames))
- winner = usernames[random_number]
- print(winner)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement