X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/053009b156c6f814fb405c8575bb294aab512627..088e48c44ae79498f459e79dcf52ff02b2467772:/sitemap.xml/index.php diff --git a/sitemap.xml/index.php b/sitemap.xml/index.php index 7d28815..0e68218 100644 --- a/sitemap.xml/index.php +++ b/sitemap.xml/index.php @@ -1,5 +1,4 @@ '; $siteref = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . '://' . $_SERVER['HTTP_HOST']; @@ -12,6 +11,14 @@ foreach ($search->files() as $link) { $article = new ArchiveArticle($link); print ''; print "$siteref/{$article->link}"; + $score = 10; + if ($article->link) { + $score -= substr_count($article->link, '/') + 1; # -10% per subdir + $age = time() - strtotime($article->dateiso); + $age /= 3600 * 24 * 365; # years + if ($age > .1) $score -= $age / 10 + .1; # -1% per year + } + printf('%.2f', $score / 10); if ($article->last) { print "{$article->lastiso}"; }