This commit is contained in:
Jeremy Fincher 2003-11-08 00:09:54 +00:00
parent 362ca56305
commit 143295104a
1 changed files with 8 additions and 4 deletions

View File

@ -72,8 +72,10 @@ class Ebay(callbacks.PrivmsgCommandAndRegexp, plugins.Configurable):
threaded = True threaded = True
regexps = ['ebaySnarfer'] regexps = ['ebaySnarfer']
configurables = plugins.ConfigurableDictionary( configurables = plugins.ConfigurableDictionary(
[('snarfer', utils.safeEval, True, 'Controls the auction snarfer.')] [('snarfer', utils.safeEval, True,
) """Determines whether the bot will automatically 'snarf' Ebay auction
URLs and print information about them.""")]
)
def __init__(self): def __init__(self):
callbacks.PrivmsgCommandAndRegexp.__init__(self) callbacks.PrivmsgCommandAndRegexp.__init__(self)
@ -124,6 +126,7 @@ class Ebay(callbacks.PrivmsgCommandAndRegexp, plugins.Configurable):
url = match.group(0) url = match.group(0)
#debug.printf(url) #debug.printf(url)
self._getResponse(irc, msg, url, snarf = True) self._getResponse(irc, msg, url, snarf = True)
ebaySnarfer = privmsgs.urlSnarfer(ebaySnarfer)
_bold = lambda self, m: (ircutils.bold(m[0]),) + m[1:] _bold = lambda self, m: (ircutils.bold(m[0]),) + m[1:]
def _getResponse(self, irc, msg, url, snarf = False): def _getResponse(self, irc, msg, url, snarf = False):
@ -134,8 +137,9 @@ class Ebay(callbacks.PrivmsgCommandAndRegexp, plugins.Configurable):
m = self._info.search(s) m = self._info.search(s)
if m: if m:
(num, desc) = m.groups() (num, desc) = m.groups()
resp.append('%s%s: %s' % (ircutils.bold('Item #'), ircutils.bold(num), resp.append('%s%s: %s' % (ircutils.bold('Item #'),
utils.htmlToText(desc))) ircutils.bold(num),
utils.htmlToText(desc)))
for r in self._searches: for r in self._searches:
m = r.search(s) m = r.search(s)
if m: if m: