From bafc660846fc4d760493bc65e23953058dfe7f8b Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 30 Oct 2011 18:40:55 -0400 Subject: [PATCH] Limit short title lengths to 50 characters. --- bot/tasks/afc_statistics.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/tasks/afc_statistics.py b/bot/tasks/afc_statistics.py index 79a6edc..e183284 100644 --- a/bot/tasks/afc_statistics.py +++ b/bot/tasks/afc_statistics.py @@ -336,7 +336,10 @@ class Task(BaseTask): return None, 0 def get_short_title(self, title): - return re.sub("Wikipedia(\s*talk)?\:Articles\sfor\screation\/", "", title) + short = re.sub("Wikipedia(\s*talk)?\:Articles\sfor\screation\/", "", title) + if len(short) > 50: + short = "".join((short[:47], "...")) + return short def get_create(self, pageid): query1 = "SELECT MIN(rev_id) FROM revision WHERE rev_page = ?"