Pogledajte određenu poruku
Staro 26. 06. 2011.   #1
webarto
expert
Grand Master
 
Avatar webarto
 
Datum učlanjenja: 11.04.2010
Poruke: 998
Hvala: 141
894 "Hvala" u 153 poruka
webarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished road
Default PHP Whois Class

Kao što ime kaže, provjereno radi com,net,org,info... Može se napraviti i parser da kupi datume isteka domene i status itd...

PHP kôd:
class Whois{
    
    public function 
check($url){
        
$data $this->curl("http://www.50webs.com/api-domains/json-whois-check.php?domain=$url");
        
$data $this->match('\("(.*?)"\);'$data);
        
$data str_replace(array("\\n"), array("\n"), $data);
        
$data stripslashes($data);
        return 
$data;
    }

    private function 
match($regex$string){
        
preg_match("#$regex#is"$string$matches);
        return 
$matches[1];
    }

    private function 
curl($url){
        
$curl curl_init();
        
curl_setopt($curlCURLOPT_URL$url);
        
curl_setopt($curlCURLOPT_ENCODING"gzip");
        
curl_setopt($curlCURLOPT_RETURNTRANSFER1);
        
$data curl_exec($curl);
        
curl_close($curl);
        return 
$data;
    }
    

PHP kôd:
$whois = new Whois;
echo 
$whois->check("devprotalk.com"); 
Citat:
...
Registrant:
UTP CODE doo
Nehruova 51a
lokal 135
Belgrade, Serbia 11000
Serbia

Registered through: WebsiteSpot.com
Domain Name: DEVPROTALK.COM
Created on: 17-May-05
Expires on: 17-May-12
Last Updated on: 12-May-11

Administrative Contact:
Pilipovic, Goran bluesman@utp-code.com
UTP CODE doo
Nehruova 51a
lokal 135
Belgrade, Serbia 11000
Serbia
113189195 Fax -- 113189195

Technical Contact:
Pilipovic, Goran bluesman@utp-code.com
UTP CODE doo
Nehruova 51a
lokal 135
Belgrade, Serbia 11000
Serbia
113189195 Fax -- 113189195

Domain servers in listed order:
NS1.UTPC2.COM
NS2.UTPC2.COM
...
__________________
Github // LinkedIn // PHP // ZCE // Stackoverflow PHP // Site5 Web Hosting
webarto je offline   Odgovorite uz citat
"Hvala" webarto za poruku: