1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #!/usr/bin/env python
- # -*- encoding: utf-8 -*-
- '''
- @Contact : liuyuqi.gov@msn.cn
- @Time : 2023/03/08 20:18:13
- @License : Copyright © 2017-2022 liuyuqi. All Rights Reserved.
- @Desc : 批量生成域名(双拼,双单词,双单词拼接)
- 参考项目: https://git.yoqi.me/lyq/SearchDomain
- '''
- import csv
- class GenerateEnDomain(object):
-
- def __init__(self):
- '''初始化列表'''
- self.initList=[]
- # self.keyword=["chat","ai"] # chat+xx
- self.keyword=["gpt"] # xx + ai
- self.composePinYin=[]
- # self.yuming=["com","cn","me","net"]
- self.yuming=["cn"]
- self.composeDomain=[]
- def run(self):
- with open(("res3.csv"), "r", encoding="utf-8") as f:
- csv_data = f.readlines()
- for row in csv_data:
- self.initList.append(row.strip())
- for i in self.initList:
- for j in self.keyword:
- self.composePinYin.append(i+j)
- # self.composePinYin.append(j+i)
- for i in self.composePinYin:
- for j in self.yuming:
- self.composeDomain.append(i+"."+j)
- with open("domain.txt","w",encoding="utf-8") as file:
- for i in self.composeDomain:
- file.write(i+"\n")
|