From 0fbfe325389ab4c3e444fabcd4eed816b8b35bb5 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Fri, 12 Dec 2003 18:33:00 +0000 Subject: [PATCH] Added an appropriate error message when acronymfinder.com cuts us off. --- plugins/Http.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/Http.py b/plugins/Http.py index 2027ace12..38d0dd0a0 100644 --- a/plugins/Http.py +++ b/plugins/Http.py @@ -366,6 +366,10 @@ class Http(callbacks.Privmsg): request = urllib2.Request(url, headers={'User-agent': 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)'}) html = webutils.getUrl(request) + if 'daily limit' in html: + s = 'Acronymfinder.com says I\'ve reached my daily limit. Sorry.' + irc.error(msg, s) + return # The following definitions are stripped and empties are removed. defs = filter(None, imap(str.strip, self._acronymre.findall(html))) utils.sortBy(lambda s: not s.startswith('[not an acronym]'), defs)