Guest User

Untitled

a guest
Aug 7th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.09 KB | None | 0 0
  1. import praw
  2. import config
  3. import time
  4. import os
  5. import random
  6.  
  7.  
  8. quote = ("")
  9.  
  10. def quoting(tup1):
  11. quote = tup1
  12. if "Nocoiner" in comment.body and comment.id not in comments_replied_to and comment.author != r.user.me():
  13. quote = "> Nocoiner"
  14. elif "nocoiner" in comment.body and comment.id not in comments_replied_to and comment.author != r.user.me():
  15. quote = "> nocoiner"
  16. elif "No coiner" in comment.body and comment.id not in comments_replied_to and comment.author != r.user.me():
  17. quote = "> No coiner"
  18. elif "no coiner" in comment.body and comment.id not in comments_replied_to and comment.author != r.user.me():
  19. quote = "> no coiner"
  20. elif "Nocoin" in comment.body and comment.id not in comments_replied_to and comment.author != r.user.me():
  21. quote = "> Nocoin"
  22. elif "NoCoin" in comment.body and comment.id not in comments_replied_to and comment.author != r.user.me():
  23. quote = "> NoCoin"
  24. else:
  25. print ("Shit went wrong")
  26. return quote
  27.  
  28. Footer = "\n\n ^\(I ^am ^a ^bot.) ^[*Website*](http://www.NocoinProject.org) ^/ ^[*Contact*](https://www.reddit.com/message/compose?to=ButtersBread&subject=NocoinShillBot+Contact)"
  29. # ^/ ^[*Submit*](https://nocoinproject.typeform.com/to/RmQcFD)
  30.  
  31. answers = random.sample([
  32. quote + "\n\n NoCoin can scale for mass adoption and this is the start of the golden bull run! " + Footer ,
  33. quote + "\n\n The institutional investors are finally coming around; Nocoin is heading to the moon! " + Footer ,
  34. quote + "\n\n People think that NoCoin is going to make them so rich, that they never have to work again. But what if this is just the catalyst to help you build something that gives you long term financial stability? " + Footer ,
  35. quote + "\n\n If you want more Nocoin, but don't have any extra fiat to buy more during the dip, your time is better spent earning more fiat then complaining about the bear market. " + Footer ,
  36. quote + "\n\n We are coming to a point where HODLing isn’t enough. If you aren’t aiding in the mass adoption of NoCoin, you are losing. " + Footer ,
  37. quote + "\n\n Market caps lowered, yet the quality technology remains the same. Inexperienced noobs sell & regular investors buy. " + Footer ,
  38. quote + "\n\n Nocoin is on a mission to democratize democracy, cure diseases and bring everlasting world peace. Join us now or get left behind. " + Footer ,
  39. quote + "\n\n Got money? Buy $NOC now and watch your net worth plummet along with the other shitcoins you have bought. Idiot. " + Footer ,
  40. quote + "\n\n I'm going to be fvcking rich! " + Footer ,
  41. quote + "\n\n Free Nocoin giveaway!" + "\n\n Send 1M Nocoin and I will send you nothing back. " + Footer,
  42. quote + "\n\n Doubled down on my initial NoCoin investment. Moved ~%7 of by BTC holdings to NoCoin this morning. " + Footer,
  43. quote + "\n\n Wow, another person shilling Nocoin. Now we're two. " + Footer], 1)
  44.  
  45.  
  46. def bot_login():
  47. print ("Logging in...")
  48. r = praw.Reddit(username = config.username,
  49. password = config.password,
  50. client_id = config.client_id,
  51. client_secret = config.client_secret,
  52. user_agent = "NocoinShillBot")
  53. print ("Logged in!")
  54.  
  55. return r
  56.  
  57. def run_bot(r, comments_replied_to):
  58. print ("Searching last 1,000 comments")
  59.  
  60. for comment in r.subreddit('Buttcoin+Cryptocurrency+Bitcoin+Btc+NocoinProject').comments(limit=1000):
  61. # if "Nocoiner" in comment.body and comment.id not in comments_replied_to and comment.author != r.user.me():
  62. if ("Nocoiner" in comment.body or "nocoiner" in comment.body or "No coiner" in comment.body or "no coiner" in comment.body or "Nocoin" in comment.body or "NoCoin" in comment.body) and (comment.id not in comments_replied_to) and (comment.author != r.user.me()):
  63. print ("String with \"Nocoiner\" found in comment " + comment.id)
  64. comment.reply(answers)
  65. print ("Replied to comment " + comment.id)
  66.  
  67. comments_replied_to = [];
  68. comments_replied_to.append(comment.id)
  69.  
  70. with open ("comments_replied_to.txt", "a") as f:
  71. f.write(comment.id + "\n")
  72.  
  73. print ("Search Completed.")
  74.  
  75. print (comments_replied_to)
  76.  
  77. print ("Sleeping for 10 sec...")
  78.  
  79. time.sleep(10)
  80.  
  81. def get_saved_comments():
  82. if not os.path.isfile("comments_replied_to.txt"):
  83. comments_replied_to = []
  84. else:
  85. with open("comments_replied_to.txt", "r") as f:
  86. comments_replied_to = f.read()
  87. comments_replied_to = comments_replied_to.split("\n")
  88. comments_replied_to = filter(None, comments_replied_to)
  89.  
  90. return comments_replied_to
  91.  
  92. r = bot_login()
  93. comments_replied_to = get_saved_comments()
  94. print (comments_replied_to)
  95.  
  96. while True:
  97. run_bot(r, comments_replied_to)
Add Comment
Please, Sign In to add comment