Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ####################### reddit bot ############################
- import time
- import praw
- import config
- ####### REDDIT Credentials #############
- def reddit_cred():
- r = praw.Reddit(username = config.username,
- password = config.password,
- client_id = 'UYdWXwNAMaHuRw',
- client_secret = 'IB1yLBIiXqXdd-fP6xM_eRrmdr8',
- redirect_uri = 'https://www.whiterabot.com',
- user_agent = 'lionsarmor')
- return (r)
- r = reddit_cred()
- ###### Functions
- def intro():
- print("******************************************\n\n\nWelcome to the reddit term search and poster!\n\n\n\n**************************************** ")
- def post_red(r):
- red = (input("Enter a subreddit: "))
- term = (input("enter the term you want to find in the subreddit: "))
- # option to hardcode a list of search terms instead of entering a single search term.
- list = ['automation, desktop automation', 'white rabot','freelancer programmer wanted', 'Programmer wanted', 'program for cash' ]
- for submission in r.subreddit(red).comments(limit=10):
- if (term) in submission.body:
- print("match...")
- time.sleep(2)
- stor = (input("What would you like to send to the match reddit posts?"))
- submission.reply(stor)
- break
- else:
- print("No match try again")
- break
- ### Function calls
- intro()
- reddit_cred()
- post_red(r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement