Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import praw
- file = open("pepe.txt", "a")
- bot = praw.Reddit(user_agent='StupidBot v0.1',
- client_id='secret :P',
- client_secret='secret :P',
- username='sn0wr4in',
- password='nop, also secret :P')
- subreddit = bot.subreddit('all')
- comments = subreddit.stream.comments()
- for comment in comments:
- text = comment.body # Fetch body
- author = comment.author # Fetch author
- if ('a' or 'b' or 'hello' or 'I') in text.lower(): //a simple condition just to test
- file.write('{0} {1}\n'.format(comment, author))
Add Comment
Please, Sign In to add comment