Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import praw
- import pdb
- import re
- import os
- import prawcore
- import random
- import time
- from praw.models import Message
- reddit=praw.Reddit(client_id='',
- client_secret='',
- username='',
- password='',
- user_agent='')
- if not os.path.isfile("posts_replid_to.txt"):
- posts_replid_to = []
- else:
- with open("posts_replid_to.txt", "r") as f:
- posts_replid_to = f.read()
- posts_replid_to = posts_replid_to.split("\n")
- posts_replid_to = list(filter(None, posts_replid_to))
- subreddit = reddit.subreddit('Memeeconomy')
- submissions = subreddit.stream.submissions()
- for submission in submissions:
- print (submission.created_utc)
- submission.author_flair_text=str(submission.author_flair_text)
- if re.search("SOL Enterprises", submission.author_flair_text, re.IGNORECASE):
- seconds=time.time()
- print (seconds)
- if submission.id not in posts_replid_to:
- piet=seconds-submission.created_utc
- print(piet)
- if piet < 50:
- time.sleep(15)
- comments=submission.comments
- for comment in comments:
- if "MemeInvestor_bot" in comment.author.name:
- print("replying to {0}'s post".format(submission.author.name))
- message1=('!invest 100%')
- comment.reply(message1)
- posts_replid_to.append(submission.id)
- with open("posts_replid_to.txt", "w") as f:
- for submission.id in posts_replid_to:
- f.write(submission.id + "\n")
- time.sleep(14400)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement