Created
December 24, 2016 02:32
-
-
Save Aenigma/a8ff15724a225b2a24b6f7ff80139173 to your computer and use it in GitHub Desktop.
get usernames on a subreddit bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import praw | |
| from sets import Set | |
| reddit = praw.Reddit() | |
| submissions = reddit.subreddit | |
| users = Set() | |
| for submission in reddit.subreddit('datasets').new(limit=1000): | |
| submission.comments.replace_more(limit=1000) | |
| for comment in submission.comments.list(): | |
| username = unicode(comment.author).encode('utf8') | |
| users.add(username) | |
| print(users) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [DEFAULT] | |
| client_id=client id | |
| client_secret=client secret | |
| user_agent=get usernames on a subreddit bot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment