コード例 #1
0
def main():

    domain_list = []
    # domain_list = get_domain()
    domain_list = ['monogram.lv']
    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=15)
        count = count + 1
        db.insert_white_whois(jobs)
        db.close_db()
コード例 #2
0
ファイル: get_domain_whois.py プロジェクト: tuian/get_whois
def main():

    domain_list = []
    # domain_list = get_domain()
    domain_list = ['monogram.lv']
    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=15)
        count = count + 1
        db.insert_white_whois(jobs)
        db.close_db()