【发布时间】:2013-04-12 07:14:36
【问题描述】:
我正在使用 API 执行 WhoIs 查询以确定域的可用性。
但是,似乎每个 TLD 都会给出不同类型的响应,因此我必须为每个 TLD 创建自定义搜索:
result.match("No match for") //.com
result.match("NOT FOUND") //.info, .org
!result.match("Administrative")//.biz
result.match("Invalid query or domain")//.tk
!result.message.match("registered")//.ca
result.match("No Match")//.edu
result.match("Status: free")//.de
result.match("Not found:")//.de
还有数百个 TLD 需要处理。当然,这不是最好的方法。是否有更简单的方法来确定域是否已注册?
【问题讨论】: