From 1ee2ac4f0b0a4deae2a163428cbe075525ae915a Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 3 May 2023 09:38:58 +0300 Subject: [PATCH] add yggo:manifest namespace --- crontab/crawler.php | 22 +++++++++++----------- public/index.php | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crontab/crawler.php b/crontab/crawler.php index 7221fde..7cbf97f 100644 --- a/crontab/crawler.php +++ b/crontab/crawler.php @@ -71,10 +71,10 @@ foreach ($db->getCrawlQueue(CRAWL_PAGE_LIMIT, time() - CRAWL_PAGE_SECONDS_OFFSET } // Get optional page meta data - $metaDescription = ''; - $metaKeywords = ''; - $metaRobots = ''; - $metaYggo = ''; + $metaDescription = ''; + $metaKeywords = ''; + $metaRobots = ''; + $metaYggoManifest = ''; foreach (@$dom->getElementsByTagName('meta') as $meta) { @@ -90,8 +90,8 @@ foreach ($db->getCrawlQueue(CRAWL_PAGE_LIMIT, time() - CRAWL_PAGE_SECONDS_OFFSET $metaRobots = @$meta->getAttribute('content'); } - if (@$meta->getAttribute('name') == 'yggo') { - $metaYggo = Filter::url(@$meta->getAttribute('content')); + if (@$meta->getAttribute('name') == 'yggo:manifest') { + $metaYggoManifest = Filter::url(@$meta->getAttribute('content')); } } @@ -103,13 +103,13 @@ foreach ($db->getCrawlQueue(CRAWL_PAGE_LIMIT, time() - CRAWL_PAGE_SECONDS_OFFSET CRAWL_HOST_DEFAULT_META_ONLY ? null : Filter::pageData($content)); // Update manifest registry - if (CRAWL_MANIFEST && !empty($metaYggo) && filter_var($metaYggo, FILTER_VALIDATE_URL) && preg_match(CRAWL_URL_REGEXP, $metaYggo)) { + if (CRAWL_MANIFEST && !empty($metaYggoManifest) && filter_var($metaYggoManifest, FILTER_VALIDATE_URL) && preg_match(CRAWL_URL_REGEXP, $metaYggoManifest)) { - $metaYggoCRC32url = crc32($metaYggo); + $metaYggoManifestCRC32 = crc32($metaYggoManifest); - if (!$db->getManifest($metaYggoCRC32url)) { - $db->addManifest($metaYggoCRC32url, - $metaYggo, + if (!$db->getManifest($metaYggoManifestCRC32)) { + $db->addManifest($metaYggoManifestCRC32, + $metaYggoManifest, (string) CRAWL_MANIFEST_DEFAULT_STATUS, time()); } diff --git a/public/index.php b/public/index.php index 252a50c..221af9f 100644 --- a/public/index.php +++ b/public/index.php @@ -22,7 +22,7 @@ $placeholder = Filter::plural($totalPages, [sprintf(_('Over %s page or enter the <?php echo _('YGGo! Web Search Engine') ?> - +