chiark / gitweb /
new flirt from rjk
[irc.git] / commands.py
index fa80e00e74851c7880260ca50f17b70bc14987b5..b2df479f8eef6f4ef0c0a2834f94721053942fd8 100644 (file)
@@ -233,7 +233,7 @@ def googleq(bot, cmd, nick, conn, public):
 # Look up the definition of something using google
 def defineq(bot, cmd, nick, conn, public):
     cmdrest = string.join(cmd.split()[1:])
-    targ = ("http://www.google.com/search?q=define%%3A%s&ie=utf-8&oe=utf-8"
+    targ = ("http://www.google.co.uk/search?q=define%%3A%s&ie=utf-8&oe=utf-8"
             % urllib.quote_plus(cmdrest))
     try:
         # Just slurp everything into a string
@@ -246,7 +246,7 @@ def defineq(bot, cmd, nick, conn, public):
         # first <li> in a <ul type="disc" class=std>
         # Following that we assume that each definition is all the non-markup
         # before a <br> tag. Currently we just dump out the first definition.
-        match = re.search(r"Definitions of <b>.*?</b> on the Web.*?<li>\s*([^>]*)<br>",defnpage,re.MULTILINE)
+        match = re.search(r"Definitions of <b>.*?</b> on the Web.*?<li>\s*([^>]*)((<br>)|(<li>))",defnpage,re.MULTILINE)
         if match == None:
            bot.automsg(public,nick,"Some things defy definition.")
         else: