Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import praw
- import time
- import datetime
- import urllib3
- import requests
- import json
- from urllib.parse import urlparse
- Bigboi = []
- postDict = {}
- reddit = praw.Reddit(
- client_id='qTnjdOyhvYjzWw',
- client_secret='t7pZnB4QboZ9r1x09-QEUO5NHdI',
- password='AAa748141748141aA',
- user_agent='mama',
- username='MyRSSbot')
- print("\nAuthenticated as {}".format(reddit.user.me()))
- def main():
- print('\nPMing..')
- x = '\n'
- for message in reddit.inbox.sent(limit=10):
- x += message.body
- for log in reddit.subreddit('mod').mod.log(limit=100):
- if log.mod != 'Aevann' and log.mod != 'AutoModerator' and log.action != 'approvecomment' and log.action != 'removecomment' and log.action != 'distinguish' and log.target_permalink not in x:
- reddit.redditor('Aevann').message('beep beep lettuce', str(log.mod) + ' ' + str(log.action) + ' ' + str(log.target_permalink))
- print('\nPMd' + ' "' + str(log.mod) + ' ' + str(log.action) + ' ' + str(log.target_fullname) + '"')
- print('PMing finished!')
- print('\nPosting articles..')
- for post in reddit.subreddit('POTUSWatch').hot(limit=12):
- if post.saved or post.domain == 'twitter.com' or post.domain == 'reddit.com':
- continue
- try:
- excerpts = json.loads(requests.post(f"http://api.smmry.com/?SM_API_KEY=AA52C3B194&SM_WITH_BREAK&SM_LENGTH=69&SM_URL={post.url}").text)['sm_api_content'].split("[BREAK]")[:-1]
- if post.domain == 'whitehouse.gov':
- commentboi = f"###Statement:"
- if post.domain != 'whitehouse.gov':
- commentboi = f"###Article:"
- for excerpt in excerpts:
- commentboi += f"\n\n>{excerpt.strip()}\n"
- post.reply(commentboi)
- post.save()
- print('\n' + post.url)
- time.sleep(20)
- except Exception as e:
- print('Articles finished!')
- break
- print('\nLoading post list..')
- try:
- with open('Bigboi.txt', encoding='utf-8',mode='r') as text_file:
- for line in text_file:
- Bigboi.append(str(line.rstrip('\n')))
- except Exception as e:
- print('Failed to load post list: ', str(e))
- time.sleep(1800)
- main()
- for submission in reddit.subreddit('me_irl').hot(limit=10):
- match = False
- for x in range (0, len(Bigboi)):
- if submission.url == Bigboi[x]:
- match = True
- break
- if match == False:
- postDict[submission.url] = [('I_irl'), ('OP: u/' + str(submission.author))]
- for submission in reddit.subreddit('meirl').hot(limit=10):
- match = False
- for x in range (0, len(Bigboi)):
- if submission.url == Bigboi[x]:
- match = True
- break
- if match == False:
- postDict[submission.url] = [('I_irl'), ('OP: u/' + str(submission.author))]
- for submission in reddit.subreddit('dankchristianmemes+memeeconomy+biomememes+smoobypost+teenagers+2meirl4meirl+dankmemes+historymemes+trippinthroughtime+teleshits+surrealmemes+starterpacks+bertstrips+bikinibottomtwitter+dank_meme+memes+prequelmemes+fakehistoryporn').hot(limit=25):
- match = False
- for x in range (0, len(Bigboi)):
- if submission.url == Bigboi[x]:
- match = True
- break
- if match == False:
- postDict[submission.url] = [('I_irl'), ('OP: u/' + str(submission.author))]
- if len(postDict) == 0:
- print('No new posts')
- else:
- try:
- for k, v in postDict.items():
- post = reddit.subreddit('i_irl').submit(str(v[0]), url=k)
- post.reply(str(v[1]))
- Bigboi.append(k)
- print('\nPosted' + str(post.shortlink))
- print('Saving post to list..')
- post = str(k)
- try:
- with open('Bigboi.txt', encoding='utf-8', mode='a') as text_file:
- text_file.write(k + '\n')
- except Exception as e:
- print('Failed to save post..', str(e))
- print('String..', post)
- time.sleep(1800)
- main()
- except Exception as e:
- print('Failed to post: ' + str(e))
- postDict.clear()
- time.sleep(1800)
- main()
- print('Posting finished!')
- postDict.clear()
- print('\nBeginning shilling..')
- for submission in reddit.subreddit('news+Worldnews+The_Donald').rising(limit=None):
- if submission.saved or str(submission.subreddit).lower() == 'POTUSWatch'.lower():
- continue
- if submission.url in [post.url for post in reddit.subreddit('POTUSWatch').new(limit=100)]:
- submission.save()
- reply = submission.reply('\This submission looks like it also fits r/POTUSWatch, can you please post it there as well ?\n\n^^beep boop I\'m a bot, PM u/Aevann if you want this subreddit excluded')
- print('http://reddit.com{}'.format(reply.permalink()))
- print('Shilling finished!')
- time.sleep(10)
- main()
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement