diff --git a/shreddit b/shreddit index ccd8973..499446f 100755 --- a/shreddit +++ b/shreddit @@ -10,6 +10,7 @@ config.read('shreddit.cfg') days = config.getint('main', 'days') whitelist = config.get('main', 'whitelist') sort = config.get('main', 'sort') +verbose = config.getboolean('main', 'verbose') r = reddit.Reddit(user_agent="Shreddit-PRAW") # add user: / pswd: to the [reddit] config section @@ -24,5 +25,6 @@ for comment in r.user.get_comments(limit=None, sort=sort): next now_time = datetime.fromtimestamp(comment.created) if now_time < before_time: - print 'Deleting: [%s]: "%s"' % (comment.subreddit, comment.body[:20]) + if verbose: + print 'Deleting: [%s]: "%s"' % (comment.subreddit, comment.body[:20]) comment.delete() diff --git a/shreddit.cfg b/shreddit.cfg index 175df50..1b93016 100644 --- a/shreddit.cfg +++ b/shreddit.cfg @@ -2,8 +2,7 @@ # or can be edited in the reddit_api [reddit] section [main] days = 7 - +sort = new +verbose = True # Don't delete from these subreddits whitelist = AskScience, TheCulture, redditdev, sysadmin, programming - -sort = new