reddit.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:apex-sigma-core 作者: lu-ci 项目源码 文件源码
def grab_post(subreddit, argument):
    if argument == 'tophot':
        post = list(subreddit.hot(limit=1))[0]
    elif argument == 'topnew':
        post = list(subreddit.new(limit=1))[0]
    elif argument == 'randomnew':
        post = secrets.choice(list(subreddit.new(limit=100)))
    elif argument == 'toptop':
        post = list(subreddit.top(limit=1))[0]
    elif argument == 'randomtop':
        post = secrets.choice(list(subreddit.top(limit=100)))
    else:
        post = secrets.choice(list(subreddit.hot(limit=100)))
    return post
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号