from CommonUtils import get_reddit_instance reddit = get_reddit_instance( "/r/infographis UnmoderatedClearer v3.0 by /u/JonLuca") sub = reddit.subreddit('infographics') numApproved = 0 for submission in sub.mod.unmoderated(limit=None): submission.mod.approve() numApproved += 1 print("Approved " + str(numApproved))
conn.close() def check_db(submission): conn = sqlite3.connect('infographics.db') c = conn.cursor() post_id = submission.id posts_db = c.execute('''SELECT * FROM comments WHERE parent_post=? LIMIT 1''', [post_id]) conn.commit() if posts_db.fetchone(): conn.close() return "found" else: conn.close() return conn = sqlite3.connect('infographics.db') c = conn.cursor() c.execute('''CREATE TABLE IF NOT EXISTS comments (comment_id, parent_post, reported)''') conn.commit() conn.close() reddit = get_reddit_instance("/r/infographics SubmissionChecker by /u/JonLuca") sub = reddit.subreddit('infographics') print("Starting Script") while True: for submission in sub.new(limit=100): process_submission(submission) time.sleep(30)
import time from CommonUtils import hours_since from CommonUtils import get_reddit_instance reddit = get_reddit_instance( "/r/infographics ClearControversial v3.0 by /u/JonLuca") sub = reddit.subreddit('infographics') while True: for submission in sub.controversial('day', limit=None): if submission.score < 10: hours = hours_since(submission.created_utc) if hours > 1: submission.mod.remove() time.sleep(3) time.sleep(3)
import time from CommonUtils import get_reddit_instance reddit = get_reddit_instance( "/r/infographics ModmailClearer v1.0 by /u/larperdoodle") subreddit = reddit.subreddit('/r/infographics') while True: for conversation in subreddit.conversations(state='new'): if len(conversation.messages) == 1: for message in conversation.messages: if message.startswith("Thank you for submitting to"): conversation.archive() time.sleep(2) time.sleep(3)
c.execute('''UPDATE comments SET reported="yes" WHERE comment_id =?''', [comment_id]) conn.commit() conn.close() time.sleep(1) conn = sqlite3.connect('infographics.db') c = conn.cursor() c.execute( '''CREATE TABLE IF NOT EXISTS comments (comment_id, parent_post, reported)''' ) conn.commit() conn.close() reddit = get_reddit_instance( "/r/infographics CheckCommentScores by /u/JonLuca") user = reddit.redditor('Infographics_Mod') print("Starting check score script") while True: for comment in user.comments.new(limit=400): comment_id = comment.id conn = sqlite3.connect('infographics.db') c = conn.cursor() posts_db = c.execute('''SELECT * FROM comments WHERE comment_id=?''', [comment_id]).fetchone() if posts_db: removed = posts_db[2] if removed == "yes": conn.close() continue