From 9eb08fa205c61ce62aed2efb6e6a8b3b6f936877 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 11 Sep 2003 18:39:47 +0000 Subject: [PATCH] Removed length restriction from deepthought. --- plugins/Http.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Http.py b/plugins/Http.py index dac643bd2..8748c5aa1 100644 --- a/plugins/Http.py +++ b/plugins/Http.py @@ -90,16 +90,16 @@ class Http(callbacks.Privmsg): Returns a Deep Thought by Jack Handey. """ url = 'http://www.tremorseven.com/aim/deepaim.php?job=view' - thought = ' ' * 512 now = time.time() + thought = None while self.deepthoughtq and now - self.deepthoughtq[0][0] > 86400: s = self.deepthoughtq.dequeue()[1] self.deepthoughts.remove(s) - while len(thought) > 430 or thought in self.deepthoughts: + while thought is None or thought in self.deepthoughts: fd = urllib2.urlopen(url) s = fd.read() thought = s.split('
')[2] - thought = ' '.join(thought.split()) + thought = utils.normalizeWhitespace(thought) self.deepthoughtq.enqueue((now, thought)) self.deepthoughts.add(thought) irc.reply(msg, thought)