Skip to content

Commit

Permalink
spaces around @ or gmail become common
Browse files Browse the repository at this point in the history
  • Loading branch information
normalhuman committed Jul 1, 2016
1 parent fabc328 commit 329c7d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion findspam.py
Expand Up @@ -144,7 +144,8 @@ def keyword_email(s, site): # a keyword and an email in the same post
keyword = regex.compile(ur"(?i)\b(training|we (will )?(offer|develop|provide)|sell|invest(or|ing|ment)|money|quality|legit|interest(ed)?|guarantee|catalog|rent|crack|opportunity|fundraising|campaign|career|employment|candidate|resume|loan|lover|husband|female|illuminati|brotherhood|(join|reach|contact|provide) (me|us|him)|spell(caster)?|doctor|(cheat|hack)(er|ing)?|spying|passport|visa|seaman|scam|pics|vampire|bless(ed)?|atm|miracle|testimony|kidney|hospital|wetting)s?\b| Dr\.? ").search(s)
if keyword:
email = regex.compile(ur"(?<![=#/])\b[A-z0-9_.%+-]+@(?!(example|domain|site|foo|\dx)\.[A-z]{2,4})[A-z0-9_.%+-]+\.[A-z]{2,4}\b").search(s)
if email:
obfuscated_email = regex.compile(ur"(?<![=#/])\b[A-z0-9_.%+-]+ *@ *gmail *\. *com\b").search(s)
if email or obfuscated_email:
return True, u"Keyword {} with email {}".format(keyword.group(0), email.group(0))
return False, ""

Expand Down

0 comments on commit 329c7d5

Please sign in to comment.