def apertium_wiki(phenny, origterm, to_nick=None): term, section = wiki.parse_term(origterm) w = wiki.Wiki(endpoints, None) match = w.search(term) if not match: phenny.say('Can\'t find anything in the Apertium Wiki for "{0}".'.format(term)) return snippet, url = wiki.extract_snippet(match, section) if to_nick: phenny.say(truncate(snippet, to_nick + ', "{}" - ' + url)) else: phenny.say(truncate(snippet, '"{}" - ' + url))
def awik(phenny, input): """.awik <term> - Look up something on the ArchWiki.""" origterm = input.group(1) if not origterm: return phenny.say('Perhaps you meant ".awik dwm"?') term, section = wiki.parse_term(origterm) w = wiki.Wiki(endpoints) match = w.search(term) if not match: phenny.say('Can\'t find anything in the ArchWiki for "{0}".'.format(term)) return snippet, url = wiki.extract_snippet(match, section) phenny.say('"{0}" - {1}'.format(snippet, url))
def vtluug(phenny, input): """.vtluug <term> - Look up something on the VTLUUG wiki.""" origterm = input.groups()[1] if not origterm: return phenny.say('Perhaps you meant ".vtluug VT-Wireless"?') term, section = wiki.parse_term(origterm) w = wiki.Wiki(endpoints) match = w.search(term) if not match: phenny.say('Can\'t find anything in the VTLUUG Wiki for "{0}".'.format(term)) return snippet, url = wiki.extract_snippet(match, section) phenny.say('"{0}" - {1}'.format(snippet, url))
def awik(phenny, input): """.awik <term> - Look up something on the ArchWiki.""" origterm = input.group(1) if not origterm: return phenny.say('Perhaps you meant ".awik dwm"?') term, section = wiki.parse_term(origterm) w = wiki.Wiki(endpoints) match = w.search(term) if not match: phenny.say( 'Can\'t find anything in the ArchWiki for "{0}".'.format(term)) return snippet, url = wiki.extract_snippet(match, section) phenny.say('"{0}" - {1}'.format(snippet, url))
def wik(phenny, input): """.wik <term> - Look up something on Wikipedia.""" origterm = input.groups()[1] if not origterm: return phenny.say('Perhaps you meant ".wik Zen"?') origterm = origterm.strip() term, section = wiki.parse_term(origterm) w = wiki.Wiki(endpoints) match = w.search(term) if not match: phenny.say('Can\'t find anything in Wikipedia for "{0}".'.format(origterm)) return snippet, url = wiki.extract_snippet(match, section) phenny.say('"{0}" - {1}'.format(snippet, url))
def wik(phenny, input): """.wik <term> - Look up something on Wikipedia.""" origterm = input.groups()[1] if not origterm: return phenny.say('Perhaps you meant ".wik Zen"?') origterm = origterm.strip() term, section = wiki.parse_term(origterm) w = wiki.Wiki(endpoints) match = w.search(term) if not match: phenny.say( 'Can\'t find anything in Wikipedia for "{0}".'.format(origterm)) return snippet, url = wiki.extract_snippet(match, section) phenny.say('"{0}" - {1}'.format(snippet, url))
def wikipedia(phenny, origterm, lang, to_user=None): if not origterm: return phenny.say('Perhaps you meant ".wik Zen"?') origterm = origterm.strip() lang = lang.strip() term, section = wiki.parse_term(origterm) w = wiki.Wiki(endpoints, lang) match = w.search(term) if not match: phenny.say('Can\'t find anything in Wikipedia for "{0}".'.format(origterm)) return snippet, url = wiki.extract_snippet(match, section) if to_user: phenny.say(truncate(snippet, to_user + ', "{}" - ' + url)) else: phenny.say(truncate(snippet, '"{}" - ' + url))
def wikipedia(phenny, origterm, lang, to_user=None): if not origterm: return phenny.say('Perhaps you meant ".wik Zen"?') origterm = origterm.strip() lang = lang.strip() term, section = wiki.parse_term(origterm) w = wiki.Wiki(endpoints, lang) match = w.search(term) if not match: phenny.say( 'Can\'t find anything in Wikipedia for "{0}".'.format(origterm)) return snippet, url = wiki.extract_snippet(match, section) if to_user: phenny.say(truncate(snippet, to_user + ', "{}" - ' + url)) else: phenny.say(truncate(snippet, '"{}" - ' + url))