Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import praw
- import time
- def run():
- print('Logging Into Reddit...')
- #Create Bot with login and private key - username - password
- bot = praw.Reddit(user_agent='AppNana Post Scheduler Bot v0.1', client_id='xyNB7BJhkza4hQ', client_secret='fNGdPVgk-WaPUqJvMEEKkauH8YY',
- username='ReiSixx9', password='')
- print('Logged in and running.')
- sub_list = ['AppNana', 'AppNanas', 'AppNana_Codes', 'Appnana_4_everybody', 'AppNanaCodeHack', 'AppnanaMoney', 'Appnanacodeexchange', 'AppnanaInviteCodes']
- title = "d25367499"
- message = ''
- i=0 #A counter for Number of loops (10 minutes)
- while 1:
- #post once per 10 minutes, post AppNana once per two hours, AppNanaCodeHack once per day
- for sub in sub_list:
- if sub == 'AppNana':
- if i % 12 == 0: #every 120 minutes, post
- redditpost(sub, title, message)
- time.sleep(600)
- else:
- continue
- elif sub == 'AppNana_Codes':
- if i % 144 == 0: #every 1440 minutes, post (24 hours)
- redditpost(sub, title, message)
- time.sleep(600)
- else:
- continue
- else:
- redditpost(sub, title, message)
- time.sleep(600)
- i+=1 #
- def redditpost(bot, sub, title, message):
- bot.subreddit(sub).submit(title, message) #Code for submitting new post on Reddit
- if __name__ == '__main__':
- run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement