Example #1
0
def get_meme(key):
    if key not in MEME_SEARCH:
        return
    else:
        meme = random.choice(MEME_SEARCH.get(key))
        meme_link = hipchat.search_all(meme)
        if hipchat.DEBUG:
                print ("""[dankBot] [DEBUG] meme search="{0}" link="{1}" """).format(meme, meme_link)
        if hipchat.NO_BATTLE_MEME:
            if "False" not in hipchat.NO_BATTLE_MEME:
                return ""
        return os.linesep + meme_link
Example #2
0
def total_definitions(define, room_id):
    definitions = get_definitions(define)

    # sends individual cards via post
    for definition in definitions:
        url = hipchat.search_all(search=define)
        json_str = text_image_card_notification(message=definition, word=define, image_url=url)
        send_room_post_response(data=json_str, room_id=room_id)

    if len(definitions) > 0:
        return str(len(definitions)) + ' total definition(s) found for ' + define

    return ''
Example #3
0
def get_meme(key):
    if key not in MEME_SEARCH:
        return
    else:
        meme = random.choice(MEME_SEARCH.get(key))
        meme_link = hipchat.search_all(meme)
        if hipchat.DEBUG:
            print(
                """[dankBot] [DEBUG] meme search="{0}" link="{1}" """).format(
                    meme, meme_link)
        if hipchat.NO_BATTLE_MEME:
            if "False" not in hipchat.NO_BATTLE_MEME:
                return ""
        return os.linesep + meme_link