Skip to content
Permalink
Browse files

updates

  • Loading branch information...
Mte90 committed Sep 25, 2019
1 parent f2ecbde commit f8faed0dfbda61e53d0b365db91075d247348066
Showing with 7 additions and 4 deletions.
  1. +7 −4 bot.py
11 bot.py
@@ -1,7 +1,8 @@
#! /usr/bin/python3
import praw
import os
import json
import praw
import time
import tweepy
import configparser

@@ -18,7 +19,7 @@
user = reddit.redditor(str(praw_config.get('user', 'nickname')))
posts = {}

# Load settings for tweepy
# Load settings for tweepy
if os.path.exists('./tweepy.ini'):
tweepy_config = configparser.RawConfigParser()
tweepy_config.read_file(open('./tweepy.ini'))
@@ -45,13 +46,15 @@
tweet_it = True
posts[post.id] = {'title': post.title, 'subreddit': str(post.subreddit).lower(), 'permalink': post.permalink}
print("Missing " + post.id + " post")

for exclude in excludes:
if exclude.lower() == str(post.subreddit).lower():
tweet_it = False
break

if tweet_it:
# Wait 10 minutes before tweet it
time.sleep(600)
# Create a tweet
api.update_status(post.title + ' via /r/' + str(post.subreddit) + "\nhttps://www.reddit.com" + post.permalink)

0 comments on commit f8faed0

Please sign in to comment.
You can’t perform that action at this time.