Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions modules/head.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down