Skip to content

Commit

Permalink
Catch Judaism's recent troll
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtOfCode- committed Jun 11, 2017
1 parent 19f93ad commit d12a860
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions findspam.py
Expand Up @@ -476,6 +476,15 @@ def mostly_dots(s, site, *args):
return False, "" return False, ""




def mevaqesh_troll(s, site):
s = s.lower().replace(' ', '')
bad = 'mevaqeshthereforehasnoshareintheworldtocome'
if s == bad:
return True, "Post matches pattern from a known troll"
else:
return False, ""


# noinspection PyClassHasNoInit # noinspection PyClassHasNoInit
class FindSpam: class FindSpam:
with open("bad_keywords.txt", "r", encoding="utf-8") as f: with open("bad_keywords.txt", "r", encoding="utf-8") as f:
Expand Down Expand Up @@ -749,6 +758,9 @@ class FindSpam:
'sites': ["skeptics.stackexchange.com", "history.stackexchange.com"], 'sites': ["skeptics.stackexchange.com", "history.stackexchange.com"],
'reason': "bad keyword in {}", 'title': True, 'body': True, 'username': False, 'stripcodeblocks': False, 'reason': "bad keyword in {}", 'title': True, 'body': True, 'username': False, 'stripcodeblocks': False,
'body_summary': False, 'max_rep': 1, 'max_score': 0}, 'body_summary': False, 'max_rep': 1, 'max_score': 0},
{'method': mevaqesh_troll, 'all': False, 'sites': 'judaism.stackexchange.com',
'reason': 'Potential "Mevaqesh" troll', 'title': False, 'body': True, 'username': False,
'stripcodeblocks': False, 'body_summary': False, 'max_rep': 11, 'max_score': 1},
# #
# Category: Suspicious links # Category: Suspicious links
# Blacklisted sites # Blacklisted sites
Expand Down

0 comments on commit d12a860

Please sign in to comment.