Example #1
0
def bang(pipein, arguments, event):
    search = pipein + " " + arguments
    search = search.replace("+","%2B")
    url = "http://www.google.com/search?hl=en&q=" + re.sub(" ", "+", search) + "&btnG=Google+Search"
    groups = fishapi.http_grep(url, "calc_img.gif>.*?<b>(.*?)<\/b>")
    try:
        response = re.sub('<sup>', '^', groups[0])
        response = re.sub('<.*?>', '', response)
        response = re.sub('([0-9]) ([0-9])', '\\1,\\2', response)
        entities = re.findall('\&#(.*?)\;', response)
        for n in entities:
            response = re.sub('&#' + n + ';', chr(int(n)), response)
        return (response, None)
    except NameError:
        return ("Look it up yourself, Google sucks.", None)
Example #2
0
def bang(pipein, arguments, event):
    search = pipein + " " + arguments
    search = search.replace("+", "%2B")
    url = "http://www.google.com/search?hl=en&q=" + re.sub(
        " ", "+", search) + "&btnG=Google+Search"
    groups = fishapi.http_grep(url, "calc_img.gif>.*?<b>(.*?)<\/b>")
    try:
        response = re.sub('<sup>', '^', groups[0])
        response = re.sub('<.*?>', '', response)
        response = re.sub('([0-9]) ([0-9])', '\\1,\\2', response)
        entities = re.findall('\&#(.*?)\;', response)
        for n in entities:
            response = re.sub('&#' + n + ';', chr(int(n)), response)
        return (response, None)
    except NameError:
        return ("Look it up yourself, Google sucks.", None)
Example #3
0
def bang(pipein, arguments, event):
    search = pipein or arguments
    url = "http://www.google.com/search?hl=en&q=" + re.sub(" ", "+", search) + "&btnG=Google+Search"
    groups = fishapi.http_grep(url, """<!--m-->.*?href="(.*?)".*?>(.*?)</a>(.*?)<span""")
    return ("Google - '%s' | %s | %s [ %s ]" % (search, re.sub("<.*?>", "", groups[1]),    re.sub("<.*?>", "", groups[2]), groups[0]), None)
Example #4
0
def bang(pipein, arguments, event):
    groups = fishapi.http_grep("http://www.webweaving.org/", "(Thou\s[^\n]*)")
    if groups:
        insult = groups[0]
        return ((arguments or pipein) + ", " + insult + "!", None)