Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import praw
- import time
- client_id = "XXXXXXXX"
- client_secret = "XXXXXXXX"
- username = "XXXXXXXX"
- password = "XXXXXXXX"
- user_agent = 'XXXXXXXX by /u/XXXXXXXX',
- def main():
- reddit = praw.Reddit(
- client_id=client_id,
- client_secret=client_secret,
- password=password,
- username=username,
- user_agent=user_agent,
- )
- started_at = time.time()
- print ">> Starting at %s" % started_at
- for comment in reddit.subreddit('AskReddit').stream.comments():
- if comment.created_utc > started_at:
- print(">> New comment %s [%s] on parent %s (preview: %s...)"
- % (comment.id, comment.created_utc,
- comment.parent_id, comment.body[:20]))
- else :
- print(">> Ignoring historical comment %s [%s]"
- % (comment.id,
- comment.created_utc))
- if __name__ == '__main__':
- main()
Add Comment
Please, Sign In to add comment