Guest User

NoIdeaShillBot

a guest
Aug 7th, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.25 KB | None | 0 0
  1. import praw
  2. import config
  3. import time
  4. import os
  5. import random
  6.  
  7. List1 = ["> Nocoin"]
  8. List2 = ["> nocoin"]
  9. List3 = ["> No coiner"]
  10. List4 = ["> no coiner"]
  11. List5 = ["> Nocoin"]
  12. List6 = ["> NoCoin"]
  13.  
  14. Footer = "\n\n---\n^\(I ^am ^a ^bot.) ^[*Website*](http://www.NocoinProject.org) ^/ ^[*Contact*](https://www.reddit.com/message/compose?to=ButtersBread&subject=NocoinShillBot+Contact)"
  15.  
  16. answers = random.sample([
  17. "\n\n NoCoin can scale for mass adoption and this is the start of the golden bull run! " + Footer ,
  18. "\n\n The institutional investors are finally coming around; Nocoin is heading to the moon! " + Footer ,
  19. "\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 ,
  20. "\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 than complaining about the bear market. " + Footer ,
  21. "\n\n We are coming to a point where HODLing isn’t enough. If you aren’t helping in the mass adoption of NoCoin, you are losing. " + Footer ,
  22. "\n\n Market caps lowered, yet the quality technology remains the same. Inexperienced noobs sell & regular investors buy. " + Footer ,
  23. "\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 ,
  24. "\n\n Got money? Buy $NOC now and watch your net worth plummet along with the other shitcoins you have bought. Idiot. " + Footer ,
  25. "\n\n Free Nocoin giveaway!" + "\n\n Send 1M Nocoin and I will send you nothing back. " + Footer,
  26. "\n\n Doubled down on my initial NoCoin investment. Moved ~%7 of by BTC holdings to NoCoin this morning. " + Footer,
  27. "\n\n Wow, another person shilling Nocoin. Now we're two. " + Footer], 1)
  28.  
  29. def bot_login():
  30. print ("Logging in...")
  31. r = praw.Reddit(username = config.username,
  32. password = config.password,
  33. client_id = config.client_id,
  34. client_secret = config.client_secret,
  35. user_agent = "NocoinShillBot")
  36. print ("Logged in!")
  37.  
  38. return r
  39.  
  40.  
  41. def run_bot(r, comments_replied_to):
  42. print ("Searching last 1,000 comments")
  43.  
  44. for comment in r.subreddit('Buttcoin+Cryptocurrency+Bitcoin+Btc+NocoinProject').comments(limit=1000):
  45.  
  46. if "Nocoiner" in comment.body and comment.id not in comments_replied_to and comment.author != r.user.me():
  47. print ("String with \"Nocoiner\" found in comment " + comment.id)
  48. comment.reply(List1 + answers)
  49. print ("Replied to comment " + comment.id)
  50.  
  51. comments_replied_to = [];
  52. comments_replied_to.append(comment.id)
  53.  
  54. with open ("comments_replied_to.txt", "a") as f:
  55. f.write(comment.id + "\n")
  56. else:
  57. if "nocoiner" in comment.body and comment.id not in comments_replied_to and comment.author != r.user.me():
  58. print ("String with \"nocoiner\" found in comment " + comment.id)
  59. comment.reply(List2 + answers)
  60. print ("Replied to comment " + comment.id)
  61.  
  62. comments_replied_to = [];
  63. comments_replied_to.append(comment.id)
  64.  
  65. with open ("comments_replied_to.txt", "a") as f:
  66. f.write(comment.id + "\n")
  67. else:
  68. if "No coiner" in comment.body and comment.id not in comments_replied_to and comment.author != r.user.me():
  69. print ("String with \"No coiner\" found in comment " + comment.id)
  70. comment.reply(List3 + answers)
  71. print ("Replied to comment " + comment.id)
  72.  
  73. comments_replied_to = [];
  74. comments_replied_to.append(comment.id)
  75.  
  76. with open ("comments_replied_to.txt", "a") as f:
  77. f.write(comment.id + "\n")
  78. else:
  79. if "no coiner" in comment.body and comment.id not in comments_replied_to and comment.author != r.user.me():
  80. print ("String with \"no coiner\" found in comment " + comment.id)
  81. comment.reply(List4 + answers)
  82. print ("Replied to comment " + comment.id)
  83.  
  84. comments_replied_to = [];
  85. comments_replied_to.append(comment.id)
  86.  
  87. with open ("comments_replied_to.txt", "a") as f:
  88. f.write(comment.id + "\n")
  89. else:
  90. if "Nocoin" in comment.body and comment.id not in comments_replied_to and comment.author != r.user.me():
  91. print ("String with \"Nocoin\" found in comment " + comment.id)
  92. comment.reply(List5 + answers)
  93. print ("Replied to comment " + comment.id)
  94.  
  95. comments_replied_to = [];
  96. comments_replied_to.append(comment.id)
  97.  
  98. with open ("comments_replied_to.txt", "a") as f:
  99. f.write(comment.id + "\n")
  100. else:
  101. if "NoCoin" in comment.body and comment.id not in comments_replied_to and comment.author != r.user.me():
  102. print ("String with \"NoCoin\" found in comment " + comment.id)
  103. comment.reply(List6 + answers)
  104. print ("Replied to comment " + comment.id)
  105.  
  106. comments_replied_to = [];
  107. comments_replied_to.append(comment.id)
  108.  
  109. with open ("comments_replied_to.txt", "a") as f:
  110. f.write(comment.id + "\n")
  111.  
  112. print ("Search Completed.")
  113.  
  114. print (comments_replied_to)
  115.  
  116. print ("Sleeping for 10 sec...")
  117.  
  118. time.sleep(10)
  119.  
  120. def get_saved_comments():
  121. if not os.path.isfile("comments_replied_to.txt"):
  122. comments_replied_to = []
  123. else:
  124. with open("comments_replied_to.txt", "r") as f:
  125. comments_replied_to = f.read()
  126. comments_replied_to = comments_replied_to.split("\n")
  127. comments_replied_to = filter(None, comments_replied_to)
  128.  
  129. return comments_replied_to
  130.  
  131.  
  132. r = bot_login()
  133. comments_replied_to = get_saved_comments()
  134. print (comments_replied_to)
  135.  
  136. while True:
  137. run_bot(r, comments_replied_to)
  138.  
  139. # END #
Add Comment
Please, Sign In to add comment