0

我一直在查看 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次粘贴,还是不行。

4

1 回答 1

0

这在文档首页的示例中有所介绍:

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

除此之外get_hot,还有上升帖的方法。

于 2016-02-18T22:10:16.597 回答