Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpebosi <mail@pebosi.net>2016-08-11 16:22:57 +0300
committerGitHub <noreply@github.com>2016-08-11 16:22:57 +0300
commit3e67a29332014e1d823427250ac4ace503af7f8d (patch)
tree7e27928ca184112965298d8ef9f03e9ac5d2a50a /plugins/SEO
parent9e673d4fd9546708a39218f36133b026094ea6d9 (diff)
simplify
Diffstat (limited to 'plugins/SEO')
-rw-r--r--plugins/SEO/Metric/DomainAge.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/plugins/SEO/Metric/DomainAge.php b/plugins/SEO/Metric/DomainAge.php
index a059b49572..836011b12e 100644
--- a/plugins/SEO/Metric/DomainAge.php
+++ b/plugins/SEO/Metric/DomainAge.php
@@ -35,6 +35,8 @@ class DomainAge implements MetricsProvider
public function getMetrics($domain)
{
+ $domain = str_replace('www.', '', $domain);
+
$ages = array();
$age = $this->getAgeArchiveOrg($domain);
@@ -72,9 +74,8 @@ class DomainAge implements MetricsProvider
*/
private function getAgeArchiveOrg($domain)
{
- $url = str_replace('www.', '', $domain);
- $data = $this->getUrl('http://wayback.archive.org/web/*/' . urlencode($url));
- preg_match('#<a href=\"([^>]*)' . preg_quote($url) . '/\">([^<]*)<\/a>#', $data, $p);
+ $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) {
@@ -93,9 +94,7 @@ class DomainAge implements MetricsProvider
*/
private function getAgeWhoIs($domain)
{
- $url = preg_replace('/^www\./', '', $domain);
- $url = 'http://www.who.is/whois/' . urlencode($url);
- $data = $this->getUrl($url);
+ $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]));
@@ -115,9 +114,7 @@ class DomainAge implements MetricsProvider
*/
private function getAgeWhoisCom($domain)
{
- $url = preg_replace('/^www\./', '', $domain);
- $url = 'http://www.whois.com/whois/' . urlencode($url);
- $data = $this->getUrl($url);
+ $data = $this->getUrl('http://www.whois.com/whois/' . urlencode($domain));
preg_match('#(?:Creation Date|Created On|created):\s*([ \ta-z0-9\/\-:\.]+)#si', $data, $p);
if (!empty($p[1])) {
$value = strtotime(trim($p[1]));