Added the ability to toggle edit text with a static or random value, or user entered input

pull/60/head
Naypam 9 years ago
parent 42ba875bce
commit 3fcbfb101a

@ -161,13 +161,21 @@ def remove_things(things):
url=thing.url.encode('utf-8')) url=thing.url.encode('utf-8'))
) )
elif isinstance(thing, Comment): elif isinstance(thing, Comment):
rep_format = config.get('replacement_format')
if rep_format == 'random':
replacement_text = get_sentence() replacement_text = get_sentence()
elif rep_format == 'dot':
replacement_text = '.'
else:
replacement_text = rep_format
msg = '/r/{3}/ #{0} with:\n\t"{1}" to\n\t"{2}"'.format( msg = '/r/{3}/ #{0} with:\n\t"{1}" to\n\t"{2}"'.format(
thing.id, thing.id,
sub(b'\n\r\t', ' ', thing.body[:78].encode('utf-8')), sub(b'\n\r\t', ' ', thing.body[:78].encode('utf-8')),
replacement_text[:78], replacement_text[:78],
thing.subreddit thing.subreddit
) )
if config.get('edit_only'): if config.get('edit_only'):
log.info('Editing (not removing) {msg}'.format(msg=msg)) log.info('Editing (not removing) {msg}'.format(msg=msg))
else: else:

@ -61,4 +61,11 @@ nuke_hours: 720
keep_a_copy: False keep_a_copy: False
save_directory: /tmp save_directory: /tmp
# Replacement text format
# Defines what you want to edit deleted content with pre-deletion (to ensure
# it's not saved in their database).
# Default: Random string. But this can be detected as spam in some cases.
# options: [random, dot, "user entered string"]
replacement_format: random
# vim: syntax=yaml ts=2 # vim: syntax=yaml ts=2

Loading…
Cancel
Save