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
  •  | 
  •  

سؤال

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)
هل كانت مفيدة؟

المحلول

From the documentation, looks like get_top_from_all()

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top