Beispiel #1
0
class Main(Module):
    pattern = re.compile('^\s*(?:wp|wiki|wikipedia)\s+(.*?)\s*$', re.I)
    require_addressing = True
    help = 'wiki <term> - look up summary of term on wikipedia'

    def __init__(self, *args, **kwargs):
        self.wiki = Wiki()

    def response(self, nick, args, kwargs):
        try:
            return self.wiki.get_summary(args)
        except Exception, e:
            log.warn('error in %s: %s' % (self.__module__, e))
            log.exception(e)
            return '%s: problem with query: %s' % (nick, e)
Beispiel #2
0
class Main(Module):
    pattern = re.compile('^\s*(?:wp|wiki|wikipedia)\s+(.*?)\s*$', re.I)
    require_addressing = True
    help = 'wiki <term> - look up summary of term on wikipedia'

    def __init__(self, *args, **kwargs):
        self.wiki = Wiki()

    def response(self, nick, args, kwargs):
        try:
            return self.wiki.get_summary(args)
        except Exception, e:
            log.warn('error in %s: %s' % (self.__module__, e))
            log.exception(e)
            return '%s: problem with query: %s' % (nick, e)
Beispiel #3
0
class Main(Module):
    pattern = re.compile('^\s*(?:cp)\s+(.*?)\s*$', re.I)
    require_addressing = True
    help = 'cp <term> - look up summary of term on conservapedia'

    def __init__(self, madcow=None):
        self.wiki = Wiki(base_url=_baseurl, random_path=_random_path,
                advert=_advert)

    def response(self, nick, args, kwargs):
        try:
            return self.wiki.get_summary(args)
        except Exception, e:
            log.warn('error in %s: %s' % (self.__module__, e))
            log.exception(e)
            return '%s: problem with query: %s' % (nick, e)
Beispiel #4
0
class Main(Module):
    pattern = re.compile('^\s*(?:cp)\s+(.*?)\s*$', re.I)
    require_addressing = True
    help = 'cp <term> - look up summary of term on conservapedia'

    def __init__(self, madcow=None):
        self.wiki = Wiki(base_url=_baseurl,
                         random_path=_random_path,
                         advert=_advert)

    def response(self, nick, args, kwargs):
        try:
            return self.wiki.get_summary(args)
        except Exception, e:
            log.warn('error in %s: %s' % (self.__module__, e))
            log.exception(e)
            return '%s: problem with query: %s' % (nick, e)