Advertisement
Guest User

Untitled

a guest
Mar 13th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. #PRAW is the reddit API wrapper
  2. import praw
  3. import config
  4.  
  5. def bot_login():
  6.     print "Logging in..."
  7.     #Logs into the given account with the Bot ID and the Bot Secret
  8.     r = praw.Reddit(username = config.username,
  9.                 password = config.password,
  10.                 client_id = config.client_id,
  11.                 client_secret = config.client_secret,
  12.                 user_agent = "HND recruiting bot v1")
  13.     print "Logged in!"
  14.  
  15.     return r
  16.  
  17. def run_bot(r):
  18.     #Postet den Post mit Titel und Text im angegebenen Subreddit.
  19.     r.subreddit('overwatchlft').submit(config.postTitle, selftext= config.postText)
  20.     print "Posted!"
  21.  
  22.  
  23.  
  24. r = bot_login()
  25. run_bot(r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement