Created
November 7, 2017 19:35
-
-
Save Miserlou/11c63d4cceca47c4df644f30541cd01c to your computer and use it in GitHub Desktop.
PRAW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def main(): | |
| """ """ | |
| reddit = praw.Reddit(user_agent='Reddit2YouTubeBot (by /u/miserlou)', | |
| client_id='your_client_id', | |
| client_secret='your_client_id', | |
| username='YourReddit2YouTubeBot', | |
| password='your_reddit_to_youtube_bot_password' | |
| ) | |
| for submission in reddit.domain('v.redd.it').new(): | |
| if not nodb.load(submission.id, default=None): | |
| result = {} | |
| result['id'] = submission.id | |
| try: | |
| process_submission(submission) | |
| result['success'] = True | |
| except Exception as e: | |
| print(e) | |
| result['success'] = False | |
| result['failure'] = str(e) | |
| nodb.save(result) | |
| print("Saved result: " + str(result)) | |
| else: | |
| print("Skipping " + submission.id) | |
| # Let's do one at a time.. | |
| break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment