Praw comment stream. I want to search for comments that in...
Praw comment stream. I want to search for comments that include some url or keywords, and obtain submission of that comment When using submission_stream or comment_stream to consume items continuously (specifically on /r/all but any sufficiently active subreddit should work), every second request includes the params lim comment_stream () yields comments indefinitely, which is good, but it starts with the oldest comment and works its way up to the newest which isn't very helpful when dealing with subreddits that get Describe the Bug When using a comment stream on a specific subreddit, if a high load of comments are pushed through the stream, some will not be processed until the stream is caught up. comments(skip_existing=True): current_comment = x. For example, to retrieve all new comments made to r/test, try: To only With PRAW, I know you can do subs = reddit. If you instead want to process all comments on Reddit, or comments belonging to one or more specific Streaming lets you create event-driven Reddit bots and applications that can respond to new submissions, comments, and moderator actions as they happen, rather than having to A simple example of how to scan Reddit's comments (in /r/all) for keywords using PRAW, send an e-mail when a comment is found, and add the results to a log file. From PRAW documentation, here’s an example of ignoring MoreComments objects with an if statement. comments(): process_comments(comment) When I run the bot and print the output of the stream function, I noticed that it also picks up some past comments, not just SubredditStream ¶ class praw. PRAW’s documentation is organized into the following sections: Unless otherwise mentioned, all examples in this document assume the use of a script application. While PRAW tries to catch all new comments, some high-volume streams, especially the r/all stream, may drop some comments. For example I've been using PRAW in my Discord bot to look for new posts in a subreddit using a subreddit stream, and post them to Discord when something new Im trying to write my first bot, and I would like to pull a comment stream for multiple subreddits, but not from all subreddits. reddit. SubredditStream(subreddit) ¶ Provides submission and comment streams. In this section, you'll learn to use the praw module for extracting comments from a given Reddit thread. comments () and Reddit. In this document, we will detail the process of finding all the comments for a given submission. Subreddit. subreddit. submissions () will yield I'm collecting some submissions for research. Reddit. See Authenticating via OAuth for PRAW can grab up to 100 comments in a single request and makes requests roughly one a second (assuming you have only a single service running using your credentials). subreddit ("Pics+Funny") to get the streams of both r/Pics and r/Funny, and I know you can do this user = reddit. redditor ("spez") to ge In these cases, you probably wouldn't want to be constantly pinging subreddits for changes, you'd rather have them streaming live, which we can also do with the Python Reddit API Wrapper. subreddit(subreddit). As you are working with a stream, you wouldn't probably get all the comments on the submission that include the given word. PRAW: The Python Reddit API Wrapper # PRAW’s documentation is organized into the following sections: Getting Started Code Overview Tutorials Package Info Documentation Conventions # PRAW: The Python Reddit API Wrapper # PRAW’s documentation is organized into the following sections: Getting Started Code Overview Tutorials Package Info Documentation Conventions # An example on how to use Python and PRAW to search keywords in streaming Reddit comments - praw-stream-keyword-example/reddit-stream-search at master · dietcheese . stream. __init__(subreddit) ¶ Create a SubredditStream instance. If you're using Python, the PRAW library has functions for streaming posts or comments. Comments appear as they become available, and at that moment, they PRAW for x in reddit. For example, say I'd like to monitor 3-4 subreddits, is there a way to do this? The gi_frame attribute of the comment_stream or subreddit_stream (depends on where the exception occurred) ends up becoming None Right now, I have fixed this solution by recreating stream again. body #process code that may take some time using current_comment If we were to do something for comment in subreddit. models. You'll also see how to fetch only the top level comments.