Guest User

Untitled

a guest
Apr 4th, 2018
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. def roundto5(x, base=5):
  2. return int(base * round(float(x)/base))
  3.  
  4. import praw
  5.  
  6. reddit=praw.Reddit(client_id='[insert client_id here]',
  7. client_secret='[insert secret key here]',
  8. username='[insert username here]',
  9. password='[insert password here]',
  10. user_agent='circleoftrustbot')
  11.  
  12. subreddit=reddit.subreddit("circleoftrust")
  13.  
  14. rising=subreddit.rising(limit=100)
  15. contacted=[]
  16. for submission in rising:
  17. flair_text=submission.author_flair_text
  18. number=flair_text.split(",")[1][1:-1]
  19. if number.isnumeric()==True:
  20. number=int(number)
  21. print(number)
  22. if number>5:
  23. advertisment=roundto5(number)
  24. subject='High volume circle trading'
  25. message="Hey! I see you like collecting circles and have a good rep - so do I. I currently am in 40 circles and I'm looking to grow. Want to trade "+str(advertisment)+" circle keys? I can go first if you like. If you have any questions feel free to PM me, I've done this kind of thing before."
  26. user=submission.author
  27. if user not in contacted:
  28. user.message(subject,message)
  29. contacted.append(user)
  30. else:
  31. subject='Key for key?'
  32. message="Hey! I'm in 40 circles and looking to expand. Want to trade keys? I'll give you one and you can give me yours. You can check how trustworthy I am by looking at my comment history and checking out my flair, the 40 next to my name means I'm in 40 circles"
  33. user=submission.author
  34. if user not in contacted:
  35. user.message(subject,message)
  36. contacted.append(user)
Advertisement
Add Comment
Please, Sign In to add comment