You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
495 B
22 lines
495 B
from hashlib import md5
|
|
|
|
from config import CRAWLER_DB_CONF
|
|
from utils.MysqlData import MysqlPoolClient
|
|
|
|
|
|
def get_group_hash(data):
|
|
M = md5()
|
|
M.update(data.encode("utf-8"))
|
|
return M.hexdigest()
|
|
|
|
|
|
def get_data_from_sql(sql, db=CRAWLER_DB_CONF):
|
|
client_mysql = MysqlPoolClient(db)
|
|
count, data = client_mysql.getOne(sql)
|
|
return data
|
|
|
|
|
|
def get_data_from_sql1(sql, db=CRAWLER_DB_CONF):
|
|
client_mysql = MysqlPoolClient(db)
|
|
data = client_mysql.getAll(sql)
|
|
return data
|