Ejemplo n.º 1
0
def update_domain_white_list():

    domain_list = []
    domain_list = difference_domain()
    print str(len(domain_list)) + ' will be inserted'
    if domain_list:
        db = Database()
        db.insert_domain_white_list(domain_list)
        db.close_db()
Ejemplo n.º 2
0
def get_domain():

    try:
        db = Database()
        sql = "SELECT domain FROM domain_white_list_whois_copy WHERE (reg_email = '' AND reg_phone ='' AND reg_name = '' AND details = '')"
        domain = db.select_domain(sql)
        domain_list = [i[0] for i in domain]
        return domain_list
    except:
        print '获得查询域名异常'
        sys.exit(1)
    finally:
        db.close_db()
Ejemplo n.º 3
0
def get_domain():

    try:
        db = Database()
        sql = "SELECT domain FROM domain_white_list_whois_copy WHERE (reg_email = '' AND reg_phone ='' AND reg_name = '' AND details = '')"
        domain = db.select_domain(sql)
        domain_list = [i[0] for i in domain]
        return domain_list
    except:
        print '获得查询域名异常'
        sys.exit(1)
    finally:
        db.close_db()
Ejemplo n.º 4
0
def main():

    domain_list = []
    domain_list = get_domain()
    total_domain_count = len(domain_list)
    print total_domain_count
    count = 0
    while count * THREADNUM < total_domain_count:
        domains = []
        db = Database()
        domains = domain_list[count * THREADNUM: (count + 1) * THREADNUM]
        jobs = [gevent.spawn(check_domain, str(domain.strip())) for domain in domains]
        gevent.joinall(jobs, timeout=10)
        count = count + 1
        db.update_white_whois(jobs)
        db.close_db()
Ejemplo n.º 5
0
def difference_domain():

    domain_list = []
    exist_domain = []
    existe_domain_temp = ()
    domain_list = get_domain()

    if not domain_list:
        print 'Domain_list is empty'
        return
    db = Database()
    existe_domain_temp = db.existed_white_domain()
    if existe_domain_temp:
        exist_domain = [i[0] for i in existe_domain_temp]

    db.close_db()
    # print len(list(set(domain_list).difference(set(exist_domain))))
    return list(set(domain_list).difference(set(exist_domain)))
Ejemplo n.º 6
0
def get_domain():

    try:
        db = Database()
        exsited_sql = 'SELECT domain FROM domain_white_list_whois_copy'
        exsited_domain = db.select_domain(exsited_sql)
        existed_domain_list = [i[0] for i in exsited_domain]
        
        check_sql = 'SELECT domain FROM domain_white_list'
        check_domain = db.select_domain(check_sql)
        check_domain_list = [i[0] for i in check_domain]
        # return list(set(existed_domain_list).difference(set(check_domain_list)))
        return list(set(check_domain_list).difference(set(existed_domain_list)))
    except:
        print '获得查询域名异常'
        sys.exit(1)
    finally:
        db.close_db()
def get_domain():

    exist_domain = []
    existe_domain_temp = ()
    check_domain_list_temp = ()
    check_domain_list = []

    db = Database()
    existe_domain_temp = db.existed_white_domain()
    if existe_domain_temp:
        exist_domain = [i[0] for i in existe_domain_temp]

    check_domain_list_temp = db.get_check_domain()
    if check_domain_list_temp:
        check_domain_list = [i[0] for i in check_domain_list_temp]
    db.close_db()
    # print len(list(set(domain_list).difference(set(exist_domain))))
    return list(set(exist_domain).difference(set(check_domain_list)))
Ejemplo n.º 8
0
def get_domain():

    try:
        db = Database()
        exsited_sql = 'SELECT domain FROM domain_white_list_whois_copy'
        exsited_domain = db.select_domain(exsited_sql)
        existed_domain_list = [i[0] for i in exsited_domain]

        check_sql = 'SELECT domain FROM domain_white_list'
        check_domain = db.select_domain(check_sql)
        check_domain_list = [i[0] for i in check_domain]
        # return list(set(existed_domain_list).difference(set(check_domain_list)))
        return list(
            set(check_domain_list).difference(set(existed_domain_list)))
    except:
        print '获得查询域名异常'
        sys.exit(1)
    finally:
        db.close_db()
Ejemplo n.º 9
0
def main():

    domain_list = []
    domain_list = get_domain()
    total_domain_count = len(domain_list)
    print total_domain_count
    count = 0
    while count * THREADNUM < total_domain_count:
        domains = []
        db = Database()
        domains = domain_list[count * THREADNUM:(count + 1) * THREADNUM]
        jobs = [
            gevent.spawn(check_domain, str(domain.strip()))
            for domain in domains
        ]
        gevent.joinall(jobs, timeout=10)
        count = count + 1
        db.update_white_whois(jobs)
        db.close_db()