From 108be18d6cc0adf43c1bdac9d376778ddc06bf4a Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 4 Jun 2023 19:26:31 +0300 Subject: [PATCH] collect meta tags from the links description --- index.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 480fdbf..b849539 100644 --- a/index.php +++ b/index.php @@ -54,8 +54,20 @@ if (preg_match('/\[(.*?)\]\((.*?)\)/ui', $signal, $data)) { - if (!empty($data[2])) { + if (!empty($data[1]) && !empty($data[2])) { + // Link description tags + if (preg_match_all('/[A-z0-9]{3,}/ui', $data[1], $matches)) { + + foreach ($matches[0] as $keyword) { + + $keyword = trim($keyword); + $keyword = mb_strtolower($keyword); + $keywords[md5($keyword)] = $keyword; + } + } + + // URI-based tags if ($query = parse_url($data[2], PHP_URL_PATH)) { foreach (explode('/', $query) as $keyword) {