mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-30 22:24:20 +01:00
Removed foldoc command (it's markedly inferior to Dict.dict).
This commit is contained in:
parent
a08c1e2332
commit
e3148c03fe
@ -49,13 +49,11 @@ import structures
|
|||||||
|
|
||||||
example = utils.wrapLines("""
|
example = utils.wrapLines("""
|
||||||
<jemfinch> @list Http
|
<jemfinch> @list Http
|
||||||
<supybot> acronym, babelize, deepthought, foldoc, freshmeat, geekquote, netcraft, randomlanguage, stockquote, title, translate, weather
|
<supybot> acronym, babelize, deepthought, freshmeat, geekquote, netcraft, randomlanguage, stockquote, title, translate, weather
|
||||||
<jemfinch> @acronym ASAP
|
<jemfinch> @acronym ASAP
|
||||||
<supybot> ASAP could be As Soon As Possible, or A Simplified Asset (disposal) Procedure, or A Stupid Acting Person (Dilbert comic strip), or Academic Strategic Alliances Program, or Accelerated Situational Awareness Prototype, or Accelerated Systems Applications and Products (data processing), or Acquisitions Strategies and Plans, or Administrative Services Automation Program, or Administrative Services Automation Project
|
<supybot> ASAP could be As Soon As Possible, or A Simplified Asset (disposal) Procedure, or A Stupid Acting Person (Dilbert comic strip), or Academic Strategic Alliances Program, or Accelerated Situational Awareness Prototype, or Accelerated Systems Applications and Products (data processing), or Acquisitions Strategies and Plans, or Administrative Services Automation Program, or Administrative Services Automation Project
|
||||||
<jemfinch> @deepthought
|
<jemfinch> @deepthought
|
||||||
<supybot> #331: Probably one of the worst things about being a genie in a magic lamp is a little thing called "lamp stench."
|
<supybot> #331: Probably one of the worst things about being a genie in a magic lamp is a little thing called "lamp stench."
|
||||||
<jemfinch> @foldoc perl
|
|
||||||
<supybot> < language , tool > A high-level programming language, started by Larry Wall in 1987 and developed as an open source project. It has an eclectic heritage, deriving from the ubiquitous C programming language and to a lesser extent from sed , awk , various Unix shell languages, Lisp , and at least a dozen other tools and languages. Originally developed for Unix , it is now available for many platforms .
|
|
||||||
<jemfinch> @freshmeat supybot
|
<jemfinch> @freshmeat supybot
|
||||||
<supybot> SupyBot, last updated 2002-08-02 19:07:52, with a vitality percent of 0.00 and a popularity of 0.09, is in version 0.36.1.
|
<supybot> SupyBot, last updated 2002-08-02 19:07:52, with a vitality percent of 0.00 and a popularity of 0.09, is in version 0.36.1.
|
||||||
<jemfinch> (yeah, I haven't updated that in awhile :))
|
<jemfinch> (yeah, I haven't updated that in awhile :))
|
||||||
@ -191,39 +189,6 @@ class Http(callbacks.Privmsg):
|
|||||||
irc.error(msg, m)
|
irc.error(msg, m)
|
||||||
return
|
return
|
||||||
|
|
||||||
def foldoc(self, irc, msg, args):
|
|
||||||
"""<something to lookup on foldoc>
|
|
||||||
|
|
||||||
FOLDOC is a searchable dictionary of acryonyms, jargon, programming
|
|
||||||
languages, tools, architecture, operating systems, networking, theory,
|
|
||||||
conventions, standards, methamatics, telecoms, electronics, history,
|
|
||||||
in fact anything having to do with computing. This commands searches
|
|
||||||
that dictionary.
|
|
||||||
"""
|
|
||||||
if not args:
|
|
||||||
raise callbacks.ArgumentError
|
|
||||||
search = '+'.join([urllib.quote(arg) for arg in args])
|
|
||||||
url = 'http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=%s' % search
|
|
||||||
try:
|
|
||||||
fd = urllib2.urlopen(url)
|
|
||||||
html = fd.read()
|
|
||||||
fd.close()
|
|
||||||
except Exception, e:
|
|
||||||
irc.error(msg, debug.exnToString(e))
|
|
||||||
return
|
|
||||||
text = html.split('<P>\n', 2)[1]
|
|
||||||
text = text.replace('.\n', '. ')
|
|
||||||
text = text.replace('\n', ' ')
|
|
||||||
text = utils.htmlToText(text)
|
|
||||||
text = text.strip()
|
|
||||||
if text:
|
|
||||||
irc.reply(msg, text)
|
|
||||||
else:
|
|
||||||
search = urllib.unquote(search)
|
|
||||||
s = 'There appears to be no definition for %s.' % search
|
|
||||||
irc.reply(msg, s)
|
|
||||||
|
|
||||||
|
|
||||||
_cityregex = re.compile(
|
_cityregex = re.compile(
|
||||||
r'<td><font size="4" face="arial"><b>'\
|
r'<td><font size="4" face="arial"><b>'\
|
||||||
r'(.*?), (.*?),(.*?)</b></font></td>', re.IGNORECASE)
|
r'(.*?), (.*?),(.*?)</b></font></td>', re.IGNORECASE)
|
||||||
|
@ -48,9 +48,6 @@ class HttpTest(PluginTestCase, PluginDocumentation):
|
|||||||
self.assertResponse('title http://www.slashdot.org/',
|
self.assertResponse('title http://www.slashdot.org/',
|
||||||
'Slashdot: News for nerds, stuff that matters')
|
'Slashdot: News for nerds, stuff that matters')
|
||||||
|
|
||||||
def testFoldoc(self):
|
|
||||||
self.assertNotError('foldoc perl')
|
|
||||||
|
|
||||||
def testGeekquote(self):
|
def testGeekquote(self):
|
||||||
self.assertNotError('geekquote')
|
self.assertNotError('geekquote')
|
||||||
self.assertNotError('geekquote multiline')
|
self.assertNotError('geekquote multiline')
|
||||||
|
Loading…
Reference in New Issue
Block a user