mirror of
https://github.com/YGGverse/YGGo.git
synced 2025-01-08 22:07:56 +00:00
add yggo:manifest namespace
This commit is contained in:
parent
56c79d8f3a
commit
1ee2ac4f0b
@ -74,7 +74,7 @@ foreach ($db->getCrawlQueue(CRAWL_PAGE_LIMIT, time() - CRAWL_PAGE_SECONDS_OFFSET
|
|||||||
$metaDescription = '';
|
$metaDescription = '';
|
||||||
$metaKeywords = '';
|
$metaKeywords = '';
|
||||||
$metaRobots = '';
|
$metaRobots = '';
|
||||||
$metaYggo = '';
|
$metaYggoManifest = '';
|
||||||
|
|
||||||
foreach (@$dom->getElementsByTagName('meta') as $meta) {
|
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');
|
$metaRobots = @$meta->getAttribute('content');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (@$meta->getAttribute('name') == 'yggo') {
|
if (@$meta->getAttribute('name') == 'yggo:manifest') {
|
||||||
$metaYggo = Filter::url(@$meta->getAttribute('content'));
|
$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));
|
CRAWL_HOST_DEFAULT_META_ONLY ? null : Filter::pageData($content));
|
||||||
|
|
||||||
// Update manifest registry
|
// 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)) {
|
if (!$db->getManifest($metaYggoManifestCRC32)) {
|
||||||
$db->addManifest($metaYggoCRC32url,
|
$db->addManifest($metaYggoManifestCRC32,
|
||||||
$metaYggo,
|
$metaYggoManifest,
|
||||||
(string) CRAWL_MANIFEST_DEFAULT_STATUS,
|
(string) CRAWL_MANIFEST_DEFAULT_STATUS,
|
||||||
time());
|
time());
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ $placeholder = Filter::plural($totalPages, [sprintf(_('Over %s page or enter the
|
|||||||
<title><?php echo _('YGGo! Web Search Engine') ?></title>
|
<title><?php echo _('YGGo! Web Search Engine') ?></title>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<?php if (API_MANIFEST_ENABLED) { ?>
|
<?php if (API_MANIFEST_ENABLED) { ?>
|
||||||
<meta name="yggo" content="<?php echo sprintf('%s/api.php?action=manifest', WEBSITE_DOMAIN) ?>" />
|
<meta name="yggo:manifest" content="<?php echo sprintf('%s/api.php?action=manifest', WEBSITE_DOMAIN) ?>" />
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="description" content="<?php echo _('Javascript-less Open Source Web Search Engine') ?>" />
|
<meta name="description" content="<?php echo _('Javascript-less Open Source Web Search Engine') ?>" />
|
||||||
|
Loading…
Reference in New Issue
Block a user