zoukankan
html css js c++ java
域名注册,抢注工具编写
首先我们准备一个词典,也就最好的域名列表,我找了最常见的英文单词列表。然后确定一个验证的网站,我选的是中国万网。
我们要做的就是从词典取出每一个词,用程序去万网测试,找到未被注册的域名列表,我选的是.com的和.cn的。运行,等待输出结果
ublic
class
DomainRegist
{
static
public
String filepath
=
"
/opt/TestHL/result.cvs
"
;
static
public
String dicPath
=
"
/opt/TestHL/dic.txt
"
;
/** */
/**
测试某个域名是否未被注册
*
@param
keyword
*/
static
public
void
testDomain(String keyword)
{
String url
=
"
http://panda.www.net.cn/cgi-bin/Check.cgi?domain=
"
+
keyword
+
"
&big5=n&com=yes&cn=yes
"
;
try
{
byte
[] pageHtml
=
HttpUtil.getPage(url);
//
将页面转成string
if
(pageHtml
!=
null
)
{
String strHtml;
try
{
strHtml
=
new
String(pageHtml,
"
GBK
"
);
String[][] result
=
StringUtil.splitByReg(strHtml,
"
domain=(.*?)'>
"
);
if
(result
!=
null
)
{
for
(
int
i
=
0
; i
<
result.length;i
++
)
for
(
int
j
=
0
;j
<
result[i].length;j
++
)
CSVWriter(filepath,result[i][j]);
}
}
catch
(UnsupportedEncodingException e)
{
e.printStackTrace();
}
}
}
catch
(Exception e)
{
e.printStackTrace();
}
}
/** */
/**
把结果输出到文本
*
@param
filePath
*
@param
line
*/
public
synchronized
static
void
CSVWriter(String filePath, String line)
{
try
{
BufferedWriter out
=
new
BufferedWriter(
new
FileWriter(filePath,
true
));
line
=
StringUtil.gbk2iso(line);
out.write(line);
out.newLine();
out.close();
}
catch
(IOException e)
{
e.printStackTrace();
}
}
/** */
/**
*
@param
args
*/
public
static
void
main(String[] args)
{
ArrayList
<
String
>
dic
=
DataDir.getSpecifiedFileData(dicPath);
for
(
int
i
=
0
;i
<
dic.size();i
++
)
{
testDomain(dic.get(i).trim());
}
}
}
查看全文
相关阅读:
如何快速取得股票交易历史数据
ArcSDE性能优化系列之ArcSDE参数篇
2020年8月29日
2020年8月31日
9.2
2020年8月25日
2020年8月30日
2020年8月27日
2020年8月26日
2020年8月28日
原文地址:https://www.cnblogs.com/polugen/p/570985.html
最新文章
pgpoolII 入门教程
nginx防盗链教程 nginx图片防盗链详细解说
postgresql数据库连接池pgbouncer的搭建
nginx下的文件下载防盗链(HttpAccessKeyModule)
Pgbouncer 介绍
BEST TECHNIQUE TO STYLE A FLEXIBLE WEB BUTTON
15 个最新的 CSS3 教程
PgSQL 负载、群集和连接池的对比
[bzoj4373]算术天才⑨与等差数列
Luogu 3616 富金森林公园
热门文章
Luogu 1379 八数码难题
Luogu 1580 [NOIP2016] 换教室
ArcSDE性能优化系列之ArcSDE参数篇
在Oracle中如何利用Rowid查找和删除表中的重复记录
股票历史数据的获取
在Oracle中如何利用Rowid查找和删除表中的重复记录
日记 20130202 阴
如何快速取得股票交易历史数据
股票历史数据的获取
ArcGIS Server for JavaScript api安装部署
Copyright © 2011-2022 走看看