diff --git a/findspam.py b/findspam.py index afb404b788..5fa4db8b07 100644 --- a/findspam.py +++ b/findspam.py @@ -606,7 +606,8 @@ def len_img_block(string): # max_score=2 to prevent voting fraud -@create_rule("post is mostly images", title=False, max_rep=201, max_score=2) +@create_rule("post is mostly images", title=False, max_rep=201, max_score=2, sites=[ + "math.stackexchange.com", "mathoverflow.net", "stats.stackexchange.com"]) def mostly_img(s, site): if len(s) == 0: return False, "" @@ -1416,8 +1417,9 @@ def strip_urls_and_tags(s): return URL_REGEX.sub("", TAG_REGEX.sub("", s)) -@create_rule("mostly punctuation marks in {}", max_rep=52, - sites=["math.stackexchange.com", "mathoverflow.net", "codegolf.stackexchange.com"]) +@create_rule("mostly punctuation marks in {}", max_rep=52, sites=[ + "stats.stackexchange.com", "math.stackexchange.com", + "mathoverflow.net", "codegolf.stackexchange.com"]) def mostly_punctuations(s, site): # Strip code blocks here rather than with `stripcodeblocks` so we get the length of the whole post in s. body = regex.sub(r"(?s).*?", "", s) diff --git a/test/test_findspam.py b/test/test_findspam.py index 7e21796050..057d48c42e 100644 --- a/test/test_findspam.py +++ b/test/test_findspam.py @@ -72,9 +72,9 @@ ('Should not be caught: http://example.com', '', '', 'drupal.stackexchange.com', False, False, False), ('Should not be caught: https://www.example.com', '', '', 'drupal.stackexchange.com', False, False, False), ('Should not be caught: something@example.com', '', '', 'drupal.stackexchange.com', False, False, False), - ('Title here', 'my image', '', 'stackoverflow.com', False, False, True), - ('Title here', 'my image', '', 'stackoverflow.com', False, False, True), - ('Title here', 'page', '', 'stackoverflow.com', False, False, False), + ('Title here', 'my image', '', 'askubuntu.com', False, False, True), + ('Title here', 'my image', '', 'askubuntu.com', False, False, True), + ('Title here', 'page', '', 'askubuntu.com', False, False, False), ('Error: 2147467259', '', '', 'stackoverflow.com', False, False, False), ('Max limit on number of concurrent ajax request', """

Php java script boring yaaarrr Price-Buy.com

""", 'Price Buy', 'stackoverflow.com', True, True, True), ('Proof of onward travel in Japan?', """

The best solution to overcome the problem of your travelenter image description here