Browse Source

Removed autocomplete

Pablo Ferreiro 2 years ago
parent
commit
a67d2197cc
3 changed files with 0 additions and 29 deletions
  1. 0 16
      engines/google/suggestions.php
  2. 0 3
      opensearch.xml.example
  3. 0 10
      suggestions.php

+ 0 - 16
engines/google/suggestions.php

@@ -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;
-    }

+ 0 - 3
opensearch.xml.example

@@ -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" />

+ 0 - 10
suggestions.php

@@ -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);