Piwik\Plugins\SEO\Metric\DomainAge::getAgeWhoIs PHP Method

getAgeWhoIs() private method

Returns the domain age who.is lists for the current url
private getAgeWhoIs ( string $domain ) : integer
$domain string
return integer
    private function getAgeWhoIs($domain)
    {
        $data = $this->getUrl('http://www.who.is/whois/' . urlencode($domain));
        preg_match('#(?:Creation Date|Created On|created|Registered on)\\.*:\\s*([ \\ta-z0-9\\/\\-:\\.]+)#si', $data, $p);
        if (!empty($p[1])) {
            $value = strtotime(trim($p[1]));
            if ($value === false) {
                return 0;
            }
            return $value;
        }
        return 0;
    }