Powerful script to put all DOT COM and their status into a Database
This is completely OK... WHOIS is provided by InterNIC via port 43 for unlimited free lookups.
CREATE TABLE `domains` ( `domain` varchar(6) NOT NULL, `len` tinyint(1) unsigned NOT NULL, `available` tinyint(1) unsigned NOT NULL, `expires` date NOT NULL, `checked` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`domain`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
<?php set_time_limit(0); = 'localhost'; = 'foo'; = 'bar'; = 'whois'; = mysql_connect(, , ); mysql_select_db(); for( = 'aaa'; <= 'zzzz'; ++) { = strlen(); if( = fsockopen ('whois.internic.net', 43)) { = NULL; fputs(, "domain .comrn"); while(!feof()) { .= fgets(, 128); } fclose(); } if(strpos(, 'No match for domain') !== FALSE) mysql_query("INSERT INTO `domains` VALUES ('', '', 1, '0000-00-00', NULL);") or die( . ' - ' .mysql_error()); else { preg_match('/Expiration Date: (.+?)n/', , ); = strtotime(); = date('Y-m-d', ); mysql_query("INSERT INTO `domains` VALUES ('', '', 0, '', NULL);") or die( . ' - ' .mysql_error()); } } mysql_close(); ?> |
DHV Delivery Systems FAILING at online dating???
The Hydrurga WSO - Rank Your Site #1 And Score Over The Penguin Updates!