Guest User

Untitled

a guest
Oct 25th, 2018
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. reddit.subreddit(sub_reddit).flair.set('bboe', 'bahissiteleri flair')
  2.  
  3. import praw
  4. sub_reddit = 'bahissiteleri' #this is the subreddit you are posting to.
  5.  
  6. post_title = 'Check' # this is the post title
  7. post_body = "check" # this is the post text/body
  8.  
  9.  
  10. reddit = praw.Reddit(
  11. client_id='id',
  12. client_secret='secret',
  13. username='username',
  14. password='password',
  15. user_agent="Agent to post")
  16.  
  17. def authenticate(reddit):
  18. print(reddit.user.me())
  19.  
  20. def self_post():
  21. # try:
  22. # post = reddit.subreddit(sub_reddit).submit(title=post_title, selftext=post_body)
  23. # reddit.subreddit(sub_reddit).flair.set('bboe', '')
  24. sub=reddit.subreddit(sub_reddit)
  25. post = sub.submit(title=post_title, selftext=post_body)
  26.  
  27. reddit.subreddit(sub_reddit).flair.set('bboe', 'bahissiteleri flair')
  28. print("DONE")
  29.  
  30.  
  31. if __name__ == '__main__':
  32. authenticate(reddit)
  33. self_post()
Add Comment
Please, Sign In to add comment