Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import praw
- import time
- reddit = praw.Reddit(client_id='xx',
- client_secret='yy',
- username='ww',
- password='zz',
- user_agent='PrawTut',
- )
- subreddit = reddit.subreddit('test')
- hot_python = subreddit.hot()
- hot_python = subreddit.hot(limit=5)
- for submission in hot_python:
- if not submission.stickied:
- comments = submission.comments
- for comment in comments:
- print(20 * '-')
- print(comment.body)
- if len(comment.replies) > 0:
- for reply in comment.replies:
- print('REPLY:')
- print("\t" + reply.body)
- if "dog" in comment.body:
- print(comment.body)
- print("String with \"dog\" found in comment " + comment.id)
- comment.reply("I also love dogs! [Here](http://i.imgur.com/LLgRKeq.jpg) is an image of one!")
- print("Replied to comment " + comment.id)
- print
- "Sleeping for 10 seconds..."
- # Sleep for 10 seconds...
- time.sleep(10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement