获取升级的Reddit API(PRAW)的时间戳

问题描述 投票:1回答:1

是否有任何方法可以获取帖子的upvote时间戳,例如鲍勃在2020年12月21日下午12:30喜欢post1吗?在此先感谢

reddit praw
1个回答
0
投票

否,Reddit不提供此信息。 (通常)甚至不可能知道谁赞成评论或提交的内容。

the Reddit preferences中,有一个选项可以“公开我的投票”,该选项会在https://reddit.com/u/username/upvotedhttps://reddit.com/u/username/downvoted处公开列出用户已投票的提交的页面。这些列表也可用于在https://reddit.com/u/me/upvotedhttps://reddit.com/u/me/downvoted登录的用户(无论是否启用了该选项)。这些清单,无论是通过API还是通过Web界面访问,都不包含投票发生时间的时间戳(尽管据我所知,它们是在投票发生时进行排序的)。无法访问评论投票列表。

这里是访问上述“已投票”和“已投票”清单的方法:

# for any user with the option enabled
for submission in reddit.redditor('username').upvoted(limit=None):
    print(submission.title)
for submission in reddit.redditor('username').downvoted(limit=50):
    print(submission.title)

# for the authenticated account
for submission in reddit.user.me().upvoted(limit=None):
    print(submission.title)
for submission in reddit.user.me().downvoted(limit=50):
    print(submission.title)

请注意,在第一个示例中,您需要找到启用了设置的Reddit用户。大多数Redditor禁用了它。仅仅查看/ r / all提交的作者,我就能发现/u/CC_Panadero恰好启用了该设置,如果您想让另一个帐户测试第一个示例。

© www.soinside.com 2019 - 2024. All rights reserved.