in-irc documentation for wikipedia
This commit is contained in:
parent
ff37c5f7cb
commit
c93d99147a
|
@ -13,12 +13,15 @@ search_url = api_prefix + "?action=opensearch&search=%s&format=xml"
|
||||||
|
|
||||||
paren_re = re.compile('\s*\(.*\)$')
|
paren_re = re.compile('\s*\(.*\)$')
|
||||||
|
|
||||||
@hook.command(hook='w (.*)')
|
@hook.command(hook='w(\s+.*|$)')
|
||||||
@hook.command
|
@hook.command
|
||||||
def wiki(query):
|
def wiki(query):
|
||||||
print query
|
'''.w/.wiki <phrase> -- gets first sentence of wikipedia article on <phrase>'''
|
||||||
q = search_url % (urllib.quote(query, safe=''))
|
|
||||||
print q
|
if not query.strip():
|
||||||
|
return wiki.__doc__
|
||||||
|
|
||||||
|
q = search_url % (urllib.quote(query.strip(), safe=''))
|
||||||
x = etree.parse(q)
|
x = etree.parse(q)
|
||||||
|
|
||||||
ns = '{http://opensearch.org/searchsuggest2}'
|
ns = '{http://opensearch.org/searchsuggest2}'
|
||||||
|
|
Loading…
Reference in New Issue