I'd like to get a list of the top posts of all time in a subreddit using praw

StackOverflow https://stackoverflow.com/questions/18470007

  •  26-06-2022
  •  | 
  •  

Question

I can get the top posts for a certain day using the code below. Is there any way I can change this to the top posts of all time instead?

import praw

user_agent = "Comment Reader 1.0 by /u/crowbell"

r = praw.Reddit(user_agent=user_agent)

submissions = r.get_subreddit('askreddit').get_top(limit=5)
for x in submissions:
    print str(x)
Était-ce utile?

La solution

From the documentation, looks like get_top_from_all()

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top