Removed autocomplete
This commit is contained in:
parent
f4b865b514
commit
a67d2197cc
|
@ -1,16 +0,0 @@
|
|||
<?php
|
||||
function get_suggestions_results($query) {
|
||||
global $config;
|
||||
$query_encoded = urlencode($query);
|
||||
$url = "https://www.google.$config->google_domain/complete/search?q=$query_encoded&output=firefox&hl=$config->google_language";
|
||||
|
||||
// Make request
|
||||
$ch = curl_init($url);
|
||||
curl_setopt_array($ch, $config->curl_settings);
|
||||
$result = curl_exec($ch);
|
||||
return $result;
|
||||
}
|
||||
|
||||
function print_suggestions_results($result) {
|
||||
echo $result;
|
||||
}
|
|
@ -5,9 +5,6 @@
|
|||
<InputEncoding>UTF-8</InputEncoding>
|
||||
<LongName>LibreX search</LongName>
|
||||
<Url rel="results" type="text/html" method="get" template="http://localhost/search.php?q={searchTerms}" />
|
||||
|
||||
<Url rel="suggestions" type="application/x-suggestions+json" method="get" template="http://localhost/suggestions.php?q={searchTerms}" />
|
||||
|
||||
<Url type="application/opensearchdescription+xml"
|
||||
rel="self"
|
||||
template="/opensearch.xml?method=POST" />
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
<?php
|
||||
$config = require "config.php";
|
||||
require "engines/google/suggestions.php";
|
||||
|
||||
header('Content-Type: application/x-suggestions+json');
|
||||
header('Content-Disposition: attachment; filename="suggestions.json"');
|
||||
|
||||
$q = isset($_REQUEST['q']) ? htmlspecialchars(trim($_REQUEST["q"])) : '';
|
||||
$result = get_suggestions_results($q);
|
||||
echo print_suggestions_results($result, $q);
|
Loading…
Reference in New Issue