Ejemplo n.º 1
0
def videoURLHandler(msg):
    """Add a video URL to the database"""
    urlStart = msg.Body.lower().find("http://")
    url = ""

    urlFound = False
    x = urlStart
    while(not urlFound):
        if msg.Body[x:x+1] == " " or msg.Body[x:x+1] == "":
            url = msg.Body[urlStart:x]
            urlFound = True
        x += 1
    
    c = Command(None)
    logger.info("Inserting video url into links table: {0}".format(url))
    c.insertLink(msg.FromDisplayName, url, "VIDEO")