Results 1 to 1 of 1
Dec 21, 2010, 09:32 #1
- Join Date
- Nov 2010
- 0 Post(s)
- 0 Thread(s)
Looping domain availability check - cURL soooo slow! ??
I have an example below from the registrar and when implemented (in a loop) it takes between 500ms to 1s between checks.
I need it to run as quickly as possible, whether it be through curl or without. It seems curl takes forever between checks.
I only need the script to check one domain.
1. Is there a way to loop a post of $url and return the output foreach results, much quicker than 500ms per check? Alternative to curl?
2. Running through curl, but checking the domain availability in such a way where it does not lag in checks?
I can post the variable $domainslist (an array with a limit of 20 domains , or in my case, 20 copies of the same domain), it will exec curl, check availability on each and output with only 0.00022 avg lag between checks. When I loop the curl exec it will then run the above array of domain in lightning speed time, lag 5-8 seconds and execute the 20 again in lightning speed time.
3. Is there some way to stop that 5-8 second lag between the checks of each array? I assume not, only because it must reconnect curl..
Any help checking availability in minimal time, no matter which method, would be very much appreciated! Thanks!
Code without loop
function GetCurlPage ($pageSpec)
$ch = curl_init($pageSpec);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$tmp = curl_exec ($ch);
$tmp = preg_replace('/(?s)<meta http-equiv="Expires"[^>]*>/i', '', $tmp);
$tmp = explode('<br>', $tmp);
$returnUrl = "http://www.mysite.com/check.php";
$url = "https://www.apisite.com/availability/check.php?domain=testdomain&suffixes=.com";
$output = GetCurlPage("$url");