Python 你能用婴儿车找人吗';s在subreddit中的第一条评论?

Python 你能用婴儿车找人吗';s在subreddit中的第一条评论?,python,reddit,praw,Python,Reddit,Praw,看起来没有办法通过PRAW获取用户订阅subreddit的日期,但是有办法获取用户在特定subreddit中的第一条评论吗?我唯一能想到的方法是解析他所有的评论并过滤掉在特定subreddit上的评论。然后,您可以根据comment.created_utc对该列表进行排序,并获取最早的注释 您可以解析用户的所有注释,并从特定子Reddit中筛选注释,如下所示- user = reddit.redditor('username') target_subreddit = 'target_subred

看起来没有办法通过PRAW获取用户订阅subreddit的日期,但是有办法获取用户在特定subreddit中的第一条评论吗?

我唯一能想到的方法是解析他所有的评论并过滤掉在特定subreddit上的评论。然后,您可以根据
comment.created_utc
对该列表进行排序,并获取最早的注释

您可以解析用户的所有注释,并从特定子Reddit中筛选注释,如下所示-

user = reddit.redditor('username')
target_subreddit = 'target_subreddit'
comment_list = []
# This iterates over all the comments made by the user
for comment in user.comments.new(limit=None):
    # Check if a comment belongs to your target subreddit
    if str(comment.subreddit) == target_subreddit:
        comment_list.append(comment)

# Sort comment_list based on comment.created_utc to get the oldest comment
...

非常感谢。我知道这一定是一个简单的步骤,但我也很难想出如何通过subreddit过滤用户的评论。有什么建议吗?