我一直在查看文档的praw,我根本无法找到查看所有帖子的方法。 我想做的是查看所有帖子
import ProcessingBot
import Auth
import praw
SETPHRASES = ["python", "bots", "jarmahent", "is proves there was no Global Warming in 1966", "test"]
SETPHRASE = ("This is a bot, ignore this reply")
USERNAME = Auth.pG
def run():
r = praw.Reddit(Auth.app_ua)
print("Signing In")
r.set_oauth_app_info(Auth.app_id, Auth.app_secret, Auth.app_uri)
print("Setting Oauth App Info")
r.refresh_access_information(Auth.app_refresh)
sub = r.get_subreddit("ProcessingImages")
print("Getting SubReddit")
for: #Look through all the post this is where the post finder will be
print("Finished")
return r
while True:
run()
格式化有点不对,我间隔4次并粘贴它仍然无法正常工作。
答案 0 :(得分:0)
the documentation front page上的示例中介绍了这一点:
>>> import praw
>>> r = praw.Reddit(user_agent='my_cool_application')
>>> submissions = r.get_subreddit('opensource').get_hot(limit=5)
>>> [str(x) for x in submissions]