From dc8f78256944885108f1d52b822c8677bf9d964c Mon Sep 17 00:00:00 2001 From: Minteck Date: Sun, 12 Dec 2021 11:19:38 +0100 Subject: Initial commit --- out/index.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 out/index.php (limited to 'out') diff --git a/out/index.php b/out/index.php new file mode 100644 index 0000000..cefe36b --- /dev/null +++ b/out/index.php @@ -0,0 +1,42 @@ + $entry) { + $domain = explode("/", $entry["url"])[2]; + $sim = similar_text($domain, $_GET['q'], $perc); + if (substr($domain, 0, 4) === "www.") { + $domainstr = substr($domain, 4); + } else { + $domainstr = $domain; + } + $domains[] = [ + "id" => $id, + "url" => "https://" . $domain . "/", + "domain" => $domainstr, + "relevance" => $perc / 50 - 1 + ]; + } + + usort($domains, function($a, $b) { + return $a['relevance'] <=> $b['relevance']; + }); + + $domains = array_reverse($domains); + header("Location: " . $domains[0]['url']); + die(); +} \ No newline at end of file -- cgit