diff --git a/lodgeit.wsgi b/lodgeit.wsgi new file mode 100644 index 0000000..e98c075 --- /dev/null +++ b/lodgeit.wsgi @@ -0,0 +1,9 @@ +# Example lodgeit file +from lodgeit import make_app + +application = make_app( + # the path to the database + dburi='sqlite:////path/to/lodgeit.db', + # generate with os.urandom(30) + secret_key='\x05\x82bgI\x99\xaay\xa5o\xef\xac\xa1\x93>Db\x04\xf1\x8b|\x7fT\x87|]LcM\x9d' +) diff --git a/lodgeit/lib/antispam.py b/lodgeit/lib/antispam.py index 1659825..030541a 100644 --- a/lodgeit/lib/antispam.py +++ b/lodgeit/lib/antispam.py @@ -34,9 +34,10 @@ class AntiSpam(object): """ def check_for_link_spam(self, code): + """It's spam if more than 30% of the text are links.""" lengths = (x.span() for x in LINK_RE.finditer(code)) return percentize(sum(i[1]-i[0] for i in lengths), - len(code)) > 50 + len(code)) > 30 def is_spam(self, code): """Check if one of the fields provides contains spam."""