Exemplo n.º 1
0
def store_ld_contact(name, name2, surname, position, company):
    dab = db.db_conection()
    try:
        cursor = dab.cursor()
        insert_query = "INSERT INTO `ldcontacts` (`name`,`name2`, `surname`, `position`, `company`) VALUES (%s, %s, %s, %s, %s)"
        cursor.execute(insert_query, (name, name2, surname, position, company))
        dab.commit()
        cursor.close()
        dab.close()
    except pymysql.Error as mysql_err:
        logging.info("store_ld_contact - ", mysql_err)
        dab.close()
    return
Exemplo n.º 2
0
def store_tweet_tag(tweet_id, hashtag):
    """
       Store HASHTAGS tweet into the DB
    """
    dab = db.db_conection()
    cursor = dab.cursor()
    try:
        cursor = dab.cursor()
        insert_query = "INSERT INTO `tweet_tags` (`tweet_id`, `tag`) VALUES (%s, %s)"
        cursor.execute(insert_query, (tweet_id, str(hashtag)))
        dab.commit()
        cursor.close()
        dab.close()
    except pymysql.Error as mysql_err:
        logging.info("osint-tw - ", mysql_err)
        dab.close()
    return
Exemplo n.º 3
0
def store_tweet_url(tweet_id, url):
    """
          Store URLS tweet into the DB
    """
    dab = db.db_conection()
    cursor = dab.cursor()
    try:
        cursor = dab.cursor()
        insert_query = "INSERT INTO `tweet_urls` (`tweet_id`, `url`) VALUES (%s, %s)"
        cursor.execute(insert_query, (tweet_id, url))
        dab.commit()
        cursor.close()
        dab.close()
    except pymysql.Error as mysql_err:
        logging.info("osint-tw - ", mysql_err)
        dab.close()
    return
Exemplo n.º 4
0
def store_tweet(tweet_id, text, created_at, screen_name, lang):
    """
    Store a phishing tweet into the DB. It doesn't store RT.
    """
    dab = db.db_conection()
    cursor = dab.cursor()
    try:
        cursor = dab.cursor()
        insert_query = "INSERT INTO `tweets` (`tweet_id`, `tweet_text`, `created_at`, `screen_name`, `lang`) VALUES (%s, " \
                       "%s, %s, %s, %s) "
        
        cursor.execute(insert_query, (tweet_id, text, created_at, screen_name, lang))
        dab.commit()
        cursor.close()
        dab.close()
    except pymysql.Error as mysql_err:
        logging.info("osint-tw - ", mysql_err)
        dab.close()
    return