- UID
- 1
- 帖子
- 6470
- 精华
- 43
- 积分
- 37332
- 阅读权限
- 102
- 性别
- 男
- 在线时间
- 10471 小时
- 注册时间
- 2004-11-10
- 最后登录
- 2024-8-27
|
一段查快掉了的玉米的PHP代码
<?php
/* Enter your reseller login */
$enom['user'] = 'username';
$enom['pass'] = 'password';
/* do not edit below */
$debug = FALSE; // set to TRUE to disable script and check output of variables
$enom['reseller'] = 'http://reseller.enom.com';
$enom['doCheck'] = $enom['reseller'].'/interface.asp?command=Check&uid='
.$enom['user'].'&pw='.$enom['pass'];
$enom['doPurchase'] = $enom['reseller'].'/interface.asp?command=Purchase&uid='
.$enom['user'].'&pw='.$enom['pass'];
$enom['droplist'] = 'droplist-'.date("Ymd").'.txt';
/* if today's droplist file exists, check for available names */
if(!is_file($enom['droplist'])) { exit; }
$enom['domains'] = rtrim(file_get_contents($enom['droplist']));
$enom['csv'] = str_replace("\n",',',$enom['domains']);
$enom['doList'] = $enom['doCheck'].'&DomainList='.$enom['csv'];
if($debug) { print_r($enom); exit; }
$enom['results'] = file_get_contents($enom['doList']);
/* extract available names from Check/DomainList results */
if( preg_match_all("|Domain\d{1,2}=(.*)\n|U",$enom['results'],$matches ) ) {
$domains = $matches[1];
if( preg_match_all("|RRPCode(\d{1,2})=210|U",$enom['results'],$matches) ) {
foreach($matches[1] as $match) {
$available[] = $domains[$match-1];
}
}
}
/* attempt to purchase available names */
if(count($available)>0) {
foreach($available as $domain) {
list($sld,$tld) = explode('.',trim($domain));
print "Registering $domain\n";
$enom['register'] = file($enom['doPurchase'].'&tld='.$tld.'&sld='.$sld);
}
}
print "\nDone.\n";
?> |
|