chiark
/
gitweb
/
~matthewv
/
irc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9e280b6
)
frob define to match the new google output manner
author
Matthew Vernon
<matthew@rapun.sel.cam.ac.uk>
Fri, 7 Aug 2009 14:03:37 +0000
(15:03 +0100)
committer
Matthew Vernon
<matthew@rapun.sel.cam.ac.uk>
Fri, 7 Aug 2009 14:03:37 +0000
(15:03 +0100)
commands.py
patch
|
blob
|
history
diff --git
a/commands.py
b/commands.py
index 637ec5fddffbbb14f4d1d9c0b5c2b302f2c48753..fa80e00e74851c7880260ca50f17b70bc14987b5 100644
(file)
--- a/
commands.py
+++ b/
commands.py
@@
-242,10
+242,11
@@
def defineq(bot, cmd, nick, conn, public):
# This is of course going to be a bit fragile. We first look for
# 'Definitions of %s on the Web' -- if this isn't present we
# assume we have the 'no definitions found page'.
# This is of course going to be a bit fragile. We first look for
# 'Definitions of %s on the Web' -- if this isn't present we
# assume we have the 'no definitions found page'.
- # The first defn starts after the following <p> tag.
+ # The first defn starts after the following <p> tag, but as the
+ # 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.
# 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.*?<
p
>\s*([^>]*)<br>",defnpage,re.MULTILINE)
+ match = re.search(r"Definitions of <b>.*?</b> on the Web.*?<
li
>\s*([^>]*)<br>",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: