python - 从没有 'submissions' 的 subreddit 获取所有提交

标签 python api reddit praw

有没有办法在不使用 PRAW 的函数 submissions() 的情况下从 subreddit 获取所有提交?通过提交,我能够在两个时间戳之间搜索来自给定 subreddit 的所有提交。但现在 Reddit API 已更新,不再可以在两个时间戳之间进行搜索。

对我来说,在两个不同的时间戳之间搜索并不重要,我只需要来自给定 subreddit 的所有提交。那我还有什么可以做的吗?

最佳答案

not important to search between two different timestamps, i just need all submission from a given subreddit.

在这种情况下,praw.models.Subreddit 正是您想要使用的。

for submission in reddit.subreddit('all').hot(limit=25):
    print(submission.title)

文档中有更多信息: https://praw.readthedocs.io/en/latest/code_overview/models/subreddit.html#subreddit

关于python - 从没有 'submissions' 的 subreddit 获取所有提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49670922/

相关文章:

python - Pandas:改进运行时间循环遍历包含子字符串的字符串

python - 将连续的行附加到 Python 数据框

javascript - Async/Await 实际上并没有在 while 循环中等待

java - 使用 Java 从 Azure API 获取 CPU 使用情况

python - 从Python中的对象获取数据数组

python - 将python代码(linux)移植到windows

json - 如何为嵌套的 JSON 响应设置模型类?

java - 获取 Jraw 的空访问 token

javascript - 如何在 iOS Phonegap 中设置 cookie?

python - 使用 PRAW 拉取 1000 多个热门条目