Skip to main content
 首页 » 编程设计

python之我想使用 praw 获取 subreddit 中所有时间的热门帖子列表

2025年05月04日23yyy_WW

我可以使用下面的代码获取某一天的热门帖子。有什么办法可以将其更改为所有时间的热门帖子吗?

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) 

请您参考如下方法:

来自documentation ,看起来像 get_top_from_all()