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

getAgeArchiveOrg() private method

Returns the domain age archive.org lists for the current url
private getAgeArchiveOrg ( string $domain ) : integer
$domain string
return integer
    private function getAgeArchiveOrg($domain)
    {
        $data = $this->getUrl('http://wayback.archive.org/web/*/' . urlencode($domain));
        preg_match('#<a href=\\"([^>]*)' . preg_quote($domain) . '/\\">([^<]*)<\\/a>#', $data, $p);
        if (!empty($p[2])) {
            $value = strtotime($p[2]);
            if ($value === false) {
                return 0;
            }
            return $value;
        }
        return 0;
    }