mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-23 10:34:19 +01:00
Added an appropriate error message when acronymfinder.com cuts us off.
This commit is contained in:
parent
590c9c64a0
commit
0fbfe32538
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user