[stickynotes-antispam] Delete paste if at least 2 urls were found



commit 184cc954b0ded5abda774a78f20ffb5dbe5064cc
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Fri Aug 16 14:43:45 2019 +0200

    Delete paste if at least 2 urls were found

 stickynotes-antispam.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/stickynotes-antispam.py b/stickynotes-antispam.py
index 9417daf..be7efd0 100755
--- a/stickynotes-antispam.py
+++ b/stickynotes-antispam.py
@@ -71,13 +71,13 @@ class StickyNotes(object):
 def check_if_spam(data):
     mark_for_deletion = False
 
-    # Delete paste if contains more than 4 lines starting with URL
+    # Delete paste if contains more than 2 lines containing an URL
     link_count = 0
     for line in data.splitlines():
         if re.search("http[s]?://", line, re.IGNORECASE):
             link_count += 1
 
-    if link_count >= 5:
+    if link_count >= 2:
         mark_for_deletion = True
 
     # Delete pastes with matching keywords


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]