From 45e9df8eb81401a39904ebff841825164d907fb3 Mon Sep 17 00:00:00 2001 From: Daniel Swanson Date: Thu, 30 Jun 2022 16:31:32 -0500 Subject: [PATCH] ignore Apertium URLs (closes #599) --- modules/head.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/head.py b/modules/head.py index 1a289ca9..2087ac32 100644 --- a/modules/head.py +++ b/modules/head.py @@ -19,6 +19,11 @@ from modules import wikipedia from modules import wiktionary +APERTIUM_URLS = [ + r'.*\bapertium\.(org|com)(/.*)?', + r'.*\bapertium\.projectjj\.com(/.*)?', + r'.*\bgithub\.com/apertium(/.*)?' +] # seconds until a URL title will be repeated if said multiple times TITLE_MAX_REPEAT_TIME = 300 @@ -109,6 +114,10 @@ def snarfuri(phenny, input): if nowtime - oldtime < TITLE_MAX_REPEAT_TIME: return + for pat in APERTIUM_URLS: + if re.match(pat, uri): + return + phenny.recent_titles[uri] = nowtime title = gettitle(phenny, input, uri)