Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Reddit usernames of users who use a specific subreddit

I would like to generate a list of usernames of users who use a specific subreddit.

As far as I know, it is not possible to simply get a list of users who subscribed to the subreddit. If that's not possible, it would probably be the best to go through all threads and look at who has commented.

How would I approach this?

like image 772
Hillcow Avatar asked May 23 '19 07:05

Hillcow


People also ask

Can you look up Reddit usernames?

Navigate to Reddit.com using any internet browser, or the Reddit app. 2. Using the search bar at the top of the homepage, type in the exact username of who you're looking for, and search.

How do I see posts by a specific user in a subreddit?

You can also use the following modifiers as mentioned in Reddit's advanced search: title:[text] searches only post titles. author:[username] searches only posts by the given username.

Can I check members of a subreddit?

It is not possible to get a list of subscribers. You can use Pushshift's API to get a list of all known commenters in a specific subreddit using the /reddit/comment/search? subreddit=srhere endpoint, although you might want to use PSAW for that.

Can two people have the same Reddit name?

Nope.


Video Answer


1 Answers

It is not possible to get a list of subscribers. You can use Pushshift's API to get a list of all known commenters in a specific subreddit using the /reddit/comment/search?subreddit=srhere endpoint, although you might want to use PSAW for that.

Given a reddit instance r, here's how to get it using PRAW only:

srname = 'subreddit_name_here'
users = []
sr = r.subreddit(srname)
for comment in sr.comments(limit=1000):
     a = comment.author
     if not a in users:
         users.append(a)
like image 193
justcool393 Avatar answered Oct 28 '22 06:10

justcool393