Advertisement
Guest User

CummyBotJr Code

a guest
Jul 22nd, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. """
  3. Author: Micah Croft
  4.  
  5. Purpose: Reposts pasta for mobile users.
  6.  
  7. Bugs: None
  8.  
  9. #== WORKLOG ==================================================================
  10. Date | Time | Computer name | Location | Notes
  11. 07/21/18 | 2200 | Micah's Macbook Pro | NC | N/A
  12.  
  13.  
  14. #=============================================================================
  15.  
  16. """
  17.  
  18. #=============================================================================
  19. # IMPORT STATEMENTS
  20. #=============================================================================
  21.  
  22. import time
  23. import praw
  24.  
  25.  
  26. #=============================================================================
  27. # MODULE-LEVEL VARIABLES
  28. # module_level_variable2 = 98765
  29. # """int: Module level variable documented inline."""
  30. #=============================================================================
  31.  
  32. r = praw.Reddit(user_agent = "CummyBotJr - reposts copypasta for mobile users - by u/Crawfish1997 V0.1", client_id = "XXXXXX", client_secret = "XXXXXX", password = "XXXXXX", username = "CummyBotJr")
  33.  
  34.  
  35.  
  36.  
  37.  
  38. #=============================================================================
  39. # FUNCTIONS/METHODS
  40. # def func(param1, param2):
  41. # """This function does something with the parameters.
  42. # Args:
  43. # param1 (int): The first parameter.
  44. # param2 (str): The second parameter.
  45. # Returns:
  46. # bool: The return value. True for success, False otherwise.
  47. # """
  48. # function body statements
  49. #=============================================================================
  50.  
  51. def run_bot():
  52. while True:
  53. subreddit = r.subreddit("copypasta")
  54. pasta = subreddit.new(limit=5)
  55. f = open("list.txt","a+")
  56. for submission in pasta:
  57. if submission.id not in open("list.txt").read():
  58. text = submission.selftext
  59. if len(text) < 1:
  60. None
  61. else:
  62. submission.reply(text[0:9999])
  63. f.write(str(submission.id + " "))
  64. time.sleep(1)
  65. time.sleep(15)
  66.  
  67. #=============================================================================
  68. # MAIN METHOD & TESTING AREA
  69. #=============================================================================
  70.  
  71. def main():
  72. run_bot()
  73.  
  74. if __name__ == '__main__':
  75. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement