X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/053009b156c6f814fb405c8575bb294aab512627..c7f5b415c17b1ecbf1244f13c97cb89e74bec7c4:/sitemap.xml/index.php diff --git a/sitemap.xml/index.php b/sitemap.xml/index.php index 7d28815..f0f928b 100644 --- a/sitemap.xml/index.php +++ b/sitemap.xml/index.php @@ -12,6 +12,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}"; }