Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
双拼域名采集
#!/usr/bin/env python
#vim: encoding=utf-8
__author__ = "Dreampuf<soddyque@gmail.com>"
import subprocess
import itertools
dc = "a,ai,an,ang,ao,ba,bai,ban,bang,bao,bei,ben,beng,bi,bian,biao,bie,bin,bing,bo,bu,ca,cai,can,cang,cao,ce,cei,cen,ceng,cha,chai,chan,chang,chao,che,chen,cheng,chi,chong,chou,chu,chua,chuai,chuan,chuang,chui,chun,chuo,ci,cong,cou,cu,cuan,cui,cun,cuo,da,dai,dan,dang,dao,de,dei,den,deng,di,dia,dian,diao,die,din,ding,diu,dong,dou,du,duan,dui,dun,duo,e,ei,en,eng,er,fa,fan,fang,fei,fen,feng,fiao,fo,fou,fu,ga,gai,gan,gang,gao,ge,gei,gen,geng,gong,gou,gu,gua,guai,guan,guang,gui,gun,guo,ha,hai,han,hang,hao,he,hei,hen,heng,hm,hng,hong,hou,hu,hua,huai,huan,huang,hui,hun,huo,ji,jia,jian,jiang,jiao,jie,jin,jing,jiong,jiu,ju,juan,jue,jun,ka,kai,kan,kang,kao,ke,kei,ken,keng,kong,kou,ku,kua,kuai,kuan,kuang,kui,kun,kuo,la,lai,lan,lang,lao,le,lei,leng,li,lia,lian,liang,liao,lie,lin,ling,liu,lo,long,lou,lu,luan,lun,luo,lüe,lǘ,lǚ,lǜ,ma,mai,man,mang,mao,me,mei,men,meng,mi,mian,miao,mie,min,ming,miu,mo,mou,mu,m̀,n,na,nai,nan,nang,nao,ne,nei,nen,neng,ng,ni,nia,nian,niang,niao,nie,nin,ning,niu,nong,nou,nu,nuan,nun,nuo,nüe,nǘ,nǚ,nǜ,o,ou,pa,pai,pan,pang,pao,pei,pen,peng,pi,pian,piao,pie,pin,ping,po,pou,pu,qi,qia,qian,qiang,qiao,qie,qin,qing,qiong,qiu,qu,quan,que,qun,ran,rang,rao,re,ren,reng,ri,rong,rou,ru,rua,ruan,rui,run,ruo,sa,sai,san,sang,sao,se,sen,seng,sha,shai,shan,shang,shao,she,shei,shen,sheng,shi,shou,shu,shua,shuai,shuan,shuang,shui,shun,shuo,si,song,sou,su,suan,sui,sun,suo,ta,tai,tan,tang,tao,te,tei,teng,ti,tian,tiao,tie,ting,tong,tou,tu,tuan,tui,tun,tuo,wa,wai,wan,wang,wei,wen,weng,wo,wong,wu,xi,xia,xian,xiang,xiao,xie,xin,xing,xiong,xiu,xu,xuan,xue,xun,ya,yan,yang,yao,ye,yi,yin,ying,yo,yong,you,yu,yuan,yue,yun,za,zai,zan,zang,zao,ze,zei,zen,zeng,zha,zhai,zhan,zhang,zhao,zhe,zhei,zhen,zheng,zhi,zhong,zhou,zhu,zhua,zhuai,zhuan,zhuang,zhui,zhun,zhuo,zi,zong,zou,zu,zuan,zui,zun,zuo,ń,ńg,ň,ňg,ǹ,ǹg,ḿ".split(",")
def whois(domain):
c = subprocess.Popen(["whois", domain], stdout=subprocess.PIPE);
ret = c.stdout.read();
print ('' if 'No match for' not in ret else '\033[92m') + domain
return ret, domain
ret = [whois("%s%s" % ("".join(i), ".com")) for i in itertools.product(dc, dc)]
@dreampuf

This comment has been minimized.

Copy link
Owner Author

@dreampuf dreampuf commented Nov 5, 2012

you can modify the network operate to gevent for more effect, it's also simpleness and clearly.

@audoe

This comment has been minimized.

Copy link

@audoe audoe commented Nov 5, 2012

结果太简单了,打印一下失效日期,这样才方便嘛。。

@youngsterxyf

This comment has been minimized.

Copy link

@youngsterxyf youngsterxyf commented Nov 5, 2012

这个代码有什么用么?拿来干嘛的?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment