Praw:如何获取最近24小时内创建的置顶帖子?
Praw: How to get top posts that were created in last 24 hours?
我想获得 subreddit 的热门帖子,但我只能获得所有时间的热门帖子。如何过滤搜索结果使其只查找今天的帖子?
我的代码:
top_memes = subreddit.top(limit=5)
for submission in top_memes:
print(submission.title)
.top()
的 time_filter
参数接受以下值之一:全部、日、时、月、周、年.
top_memes = subreddit.top("day", limit=5)
https://praw.readthedocs.io/en/latest/code_overview/models/subreddit.html#praw.models.Subreddit.top
我想获得 subreddit 的热门帖子,但我只能获得所有时间的热门帖子。如何过滤搜索结果使其只查找今天的帖子?
我的代码:
top_memes = subreddit.top(limit=5)
for submission in top_memes:
print(submission.title)
.top()
的 time_filter
参数接受以下值之一:全部、日、时、月、周、年.
top_memes = subreddit.top("day", limit=5)
https://praw.readthedocs.io/en/latest/code_overview/models/subreddit.html#praw.models.Subreddit.top