I have nothing to do with domain name query.

Source: Internet
Author: User

A few days ago, I talked to my friend about how to register a domain name. I thought about how many domain names I checked and found that all domain names have primary names. So I found an interface provided by hichina, the script is automatically submitted to find the domain name that can still be used. The script has been written. After one night, the script is still executed. I think the domain name must be meaningful, what is the use of blindly finding a domain name such as "dacb.com. However, it may be useful to others ~

The interfaces provided by hichina are http: // 218.30.103.77/cgi-bin/check_muitl.cgi parameter domain = dacb.com,

Returned result com | aaa.com | 211 | Domain Name is not available, of which 212 (query failed), 211 (not registered), 210 (registered)

The script I wrote mainly uses httprequest to put the domain name to be queried in the parameter to initiate a request to the interface provided by hichina and receive the returned results. If the result contains 210, it is displayed on the page, you can also change it to a database. You only need to modify processrequest () to process the logic of "registrable" and save the data asynchronously.

I only wrote a query for three characters with 26 letters. It takes too long for the four-digit query because the request times out, therefore, if a timer is added to check whether it is returned within 10 seconds, the next request is displayed.

In addition to calling interfaces, this script is the core.

VaR domainchar = new array ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'h ', 'I', 'J', 'k', 'l', 'M', 'n', 'O', 'P', 'Q', 'R ', 'S ', 't', 'U', 'V', 'w', 'x', 'y', 'z '); // define an array of 26 letters
// I1, I2, I3 indicates the current array index. To change the query start point, you only need to change their values. For example, if the query starts from GAA, I1 = 6, I2 = 0, i3 = 0; to query four digits, add an I4. Of course, the following method also needs to be modified.

VaR Index = 0; var I1 = 0; var I2 = 0; var I3 = 0; var isdocheck = 'n'; var timecheck; var domainvalue;

Function domaincheck (){
Isdocheck = 'y'; // sets the check status to true and then false when initiating a request.
Cleartime ();
Domainvalue = domainchar [I1] + domainchar [I2] + domainchar [I3]; // + domainchar [I4]; --> four
Whois_api (domainvalue, 'com ');
Timecheck = setTimeout ('checkdo () ', 10000 );

// I4 ++; --> four digits

// If (I4 = 26) {--> four digits

// I4 = 0; --> four digits
I3 ++;
If (I3 = 26 ){
I3 = 0;
I2 ++;
If (I2 = 26 ){
I2 = 0;
I1 ++;
}}}

//} --> Four digits

 

Save the code download target...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.