# Login to reddit print '[ ] logging in to reddit' username = db.get_config('reddit_user') password = db.get_config('reddit_pw') if username == None or password == None: print '[!] "reddit_user" or "reddit_pw" were not found in "config" table in database' Reddit.login(username, password) print '[ ] executing AmArch.py functionality...' def log(txt): print txt AmArch.execute(db, log) # MODERATED SUBS (real-time) print '[ ] finding modded subs...' current = Reddit.get_modded_subreddits() print '[ ] found %d subs modded by /u/%s' % (len(current), username) # remove subs that should be ignored to_ignore = db.get_config('ignore_subreddits') if to_ignore != None: for ignore in to_ignore.split(','): if ignore in current: print '[-] removing ignored subreddit: %s' % ignore current.remove(ignore) # Remove subs from db that we no longer moderate existing = [] for (sub, ) in db.select('subreddit', 'subs_mod'): if not sub in current: print '[-] subs_mod: deleting existing sub (no longer a mod): %s' % sub db.delete('subs_mod', 'subreddit = ?', [sub])