chiark / gitweb /
try and screen-scrap a bit better
authorMatthew Vernon <matthew@rapun.sel.cam.ac.uk>
Fri, 7 Aug 2009 14:29:13 +0000 (15:29 +0100)
committerMatthew Vernon <matthew@rapun.sel.cam.ac.uk>
Fri, 7 Aug 2009 14:29:13 +0000 (15:29 +0100)
commands.py

index 7e4a94c130ddee2eb090ca3ccb7ab8bd2332709d..75f3b719096502c0a23a1ce2d4ff05cd7aa4989a 100644 (file)
@@ -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.
         # 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:
         if match == None:
            bot.automsg(public,nick,"Some things defy definition.")
         else: