YGGwave~
the radio catalog
%s', self::_getSignalPosition($hash), self::_getSignalPosition($hash, true), sprintf('%s', htmlspecialchars($data[2]), htmlentities($data[1]), sprintf('', urlencode($host), htmlentities($data[1]), sprintf('background:#%s', substr(dechex($hash), 0, 6))))); } } } } } return $result; } public static function getMetaKeywords() { $keywords = []; if ($signals = file_get_contents('SIGNALS/YGGDRASIL.md')) { foreach (explode(PHP_EOL, $signals) as $signal) { if (preg_match('/\[(.*?)\]\((.*?)\)/ui', $signal, $data)) { if (!empty($data[2])) { if ($query = parse_url($data[2], PHP_URL_PATH)) { foreach (explode('/', $query) as $keyword) { $keyword = trim($keyword); if (!empty($keyword)) { $keyword = mb_strtolower($keyword); $keywords[md5($keyword)] = $keyword; }; } } } } } } return implode(',', $keywords); } private static function _getSignalPosition(int $hash, bool $reverse = false, int $padding = 20) { $variant = $reverse ? array_reverse(str_split($hash, 2)) : str_split($hash, 2); $version = 0; do { if (!isset($variant[$version])) return rand($padding, 100 - $padding); // :) $position = $variant[$version]; $version++; } while ($position < $padding || $position > 100 - $padding); return $position; } } ?>
the radio catalog