From 2bad6f5111fdab0fc5be5e7fecf774ba56243b9f Mon Sep 17 00:00:00 2001 From: Scott Date: Tue, 29 Nov 2016 18:34:41 -0600 Subject: [PATCH] Improves lorem ipsum to protect against lazy automoderation --- setup.py | 2 +- shreddit/util.py | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 190179c..03b7f6b 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup from codecs import open from os import path -VERSION = "5.0.0" +VERSION = "5.0.1" DESCRIPTION = " Remove your comment history on Reddit as deleting an account does not do so." here = path.abspath(path.dirname(__file__)) diff --git a/shreddit/util.py b/shreddit/util.py index 28baec0..9d8931f 100644 --- a/shreddit/util.py +++ b/shreddit/util.py @@ -3,8 +3,10 @@ import random -WORDLIST = "/usr/share/dict/words" -STATIC_TEXT = "I have been Shreddited for privacy!" +LOREM = """Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sit amet nulla id mi imperdiet condimentum. \ + Vestibulum ac consequat lorem, eu tempus felis. Maecenas eget purus in nisi blandit volutpat. Aenean \ + bibendum eros sit amet ex rhoncus, eu porta magna sodales. Sed venenatis sapien sit amet tempor euismod. \ + Ut a neque purus. Vestibulum quis tortor non leo eleifend interdum.""" try: @@ -16,9 +18,6 @@ except ImportError: replacement. The current solution is to return a static text string unless the operating system has a word list. If that is the case, use it instead. """ - try: - lines = [line.strip() for line in open(WORDLIST).readlines()] - return " ".join(random.sample(lines, random.randint(50, 150))) - except IOError: - # The word list wasn't available... - return STATIC_TEXT + words = LOREM.split() + random.shuffle(words) + return " ".join(words)