diff --git a/shreddit.cfg.example b/shreddit.cfg.example index e839e0f..e1a3fcf 100644 --- a/shreddit.cfg.example +++ b/shreddit.cfg.example @@ -55,4 +55,9 @@ whitelist_gilded = True # except on whitelisted subreddits but after 3 months delete everything. nuke_hours = 0 +# Only delete comments with this score or less, or delete all comments +# if this is not set. + +max_score = + # vim: syntax=config diff --git a/shreddit.py b/shreddit.py index b780bf1..317bbe8 100755 --- a/shreddit.py +++ b/shreddit.py @@ -56,6 +56,10 @@ item = config.get('main', 'item') whitelist_distinguished = config.getboolean('main', 'whitelist_distinguished') whitelist_gilded = config.getboolean('main', 'whitelist_gilded') nuke_hours = config.getint('main', 'nuke_hours') +try: + max_score = config.getint('main', 'max_score') +except ValueError: + max_score = None _user = config.get('main', 'username') _pass = config.get('main', 'password') @@ -127,6 +131,8 @@ for thing in things: continue if whitelist_gilded and thing.gilded: continue + if max_score is not None and thing.score > max_score: + continue if trial_run: # Don't do anything, trial mode! if verbose: