[stickynotes-antispam] Use re.search and increase count to 5



commit 80f06b65471e25c72fdbad052b2254ceac34d2df
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Tue Jul 30 11:37:02 2019 +0200

    Use re.search and increase count to 5

 stickynotes-antispam.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/stickynotes-antispam.py b/stickynotes-antispam.py
index 81c0136..58ca177 100755
--- a/stickynotes-antispam.py
+++ b/stickynotes-antispam.py
@@ -67,10 +67,10 @@ def check_if_spam(data):
     # Delete paste if contains more than 4 lines starting with URL
     link_count = 0
     for line in data.splitlines():
-        if re.match("http[s]?://", line, re.IGNORECASE):
+        if re.search("http[s]?://", line, re.IGNORECASE):
             link_count += 1
 
-    if link_count >= 3:
+    if link_count >= 5:
         mark_for_deletion = True
 
     # Delete pastes with matching keywords


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