Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- """
- Author: Micah Croft
- Purpose: Reposts pasta for mobile users.
- Bugs: None
- #== WORKLOG ==================================================================
- Date | Time | Computer name | Location | Notes
- 07/21/18 | 2200 | Micah's Macbook Pro | NC | N/A
- #=============================================================================
- """
- #=============================================================================
- # IMPORT STATEMENTS
- #=============================================================================
- import time
- import praw
- #=============================================================================
- # MODULE-LEVEL VARIABLES
- # module_level_variable2 = 98765
- # """int: Module level variable documented inline."""
- #=============================================================================
- 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")
- #=============================================================================
- # FUNCTIONS/METHODS
- # def func(param1, param2):
- # """This function does something with the parameters.
- # Args:
- # param1 (int): The first parameter.
- # param2 (str): The second parameter.
- # Returns:
- # bool: The return value. True for success, False otherwise.
- # """
- # function body statements
- #=============================================================================
- def run_bot():
- while True:
- subreddit = r.subreddit("copypasta")
- pasta = subreddit.new(limit=5)
- f = open("list.txt","a+")
- for submission in pasta:
- if submission.id not in open("list.txt").read():
- text = submission.selftext
- if len(text) < 1:
- None
- else:
- submission.reply(text[0:9999])
- f.write(str(submission.id + " "))
- time.sleep(1)
- time.sleep(15)
- #=============================================================================
- # MAIN METHOD & TESTING AREA
- #=============================================================================
- def main():
- run_bot()
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement