Bulk AJAX .com / .net Availability Scanner

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

RyanAM

Established Member
Impact
84
Just threw this together really quickly because I was bored.

It's just a simple availability scanner that checks only .com and .net domains, and puts the available ones into a list. It utilizes AJAX so you can scan domains in real time without waiting for a page to load.

PHP:
<?php
	function domain_status($domain){
	   $domain = strtolower($domain);
	   $o = 0; $whois = '';
	   
	   $connection = @fsockopen('whois.verisign-grs.com', 43);
		if ($connection) {
			@fputs($connection, $domain ."\r\n");
			while (!feof($connection)) {
				$whois .= @fgets($connection, 128);
			}
		 }
		fclose($connection);
		
		if(strstr($whois,"No match for")){
			$result = "<font color=green><b>Available</b></font>";
			$o=1;
		}
		
		if($o != 1){
			$result = "<font color=red><b>Taken</b></font>";
		}
		
		if(!strstr($domain,'.')) die('<b>Not a domain...</b>');
		if((!strstr($domain,'com') && !strstr($domain,'net'))) die('<b>.COM / .NET Only</b>');
		die($result);
	}
	
	if(@$_GET['domain'] != '' && @$_GET['check'] == 'true') domain_status(@$_GET['domain']);
?>
<!DOCTYPE html>
<html>
	<head>
		<title>Bulk .com / .net Availability Scanner © DomainIdiot</title>
		
		<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
	
		<style type="text/css">
			*,body{
				font-family:arial;
			}
			textarea{
				width:74%;
				height:400px;
				float:left;
				padding:5px;
			}
			.available{
				width:23%;
				float:left;
				margin-left:1%;
			}
			textarea,input{
				border:1px solid #999;
				box-shadow:0px 0px 3px #eee;
				background-color:#FEFEFE;
				border-radius:5px;
			}
			input:focus,textarea:focus,input:hover,textarea:hover{
				box-shadow:0px 0px 4px #ddd;
				outline:none;
				background-color:#F8F8F8;
				cursor:pointer;
			}
			input[type=submit]{
				float:right;
				padding:5px;
			}
			#line{
				height:10px;
				background:none;
				clear:both;
			}
		</style>
	</head>
	
	<body>
	<h1>Bulk .com / .net Availability Scanner © DomainIdiot</h1>
	
	<form method="post">
		<textarea name='domains'><?=@$_POST['domains']?></textarea>
		<textarea class='available'></textarea>
		<p>
			<input type='submit' value='Check Domains'>
		</p>
	</form>
	
	<script type="text/javascript">
		$(document).ready(function(){
			$('.domain').each(function(i,e){
				var domain = $(e).html().replace(' <b><i>Loading...</i></b>','');
				if(domain !== ''){
					$.get('<?=$_SERVER['PHP_SELF']?>?domain=' + domain + '&check=true',function(status){
						$(e).html(status + ' ' + domain);
						if(status.indexOf('Available') > -1 && domain.length > 1) $('.available').append(domain + '\n');
						$('.available').html($('.available').html().replace(/\n\s*\n/g, '\n'));
					});
				}
			});
		});
	</script>
	<div id='line'></div>
	<?php
		if(@$_POST['domains'] != ''){
			$domains = explode("\n",@$_POST['domains']);
			foreach($domains as $domain){ ?>
				<div class='domain'><?=$domain?> <b><i>Loading...</i></b></div>
	<?php   }
		}
	?>
	</body>
</html>

Just copy the code and save it as whatever you want .php, uploaded it to a server with PHP and doesn't restrict socket connections, and you're ready to go.
 
3
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back