Browse Source

fixed image results on mobile, fixed api url encoding, librex should look better now on small monitors, fixed onion address for beparanoid.de

hnhx 2 years ago
parent
commit
fd39efc8e9
4 changed files with 72 additions and 6 deletions
  1. 1 1
      README.md
  2. 53 0
      config.php
  3. 2 2
      engines/qwant/image.php
  4. 16 3
      static/css/styles.css

+ 1 - 1
README.md

@@ -13,7 +13,7 @@
 
 | Clearnet | TOR | I2P | Country |
 |-|-|-|-|
-| [librex.beparanoid.de](https://librex.beparanoid.de/) | [✅](http://librex.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion/) | [✅](http://ljluyti43556bflsucfkhegelemo6guchmq4g7ebxuentomupxoa.b32.i2p/) | 🇭🇺 HU (OFFICIAL INSTANCE) |
+| [librex.beparanoid.de](https://librex.beparanoid.de/) | [✅](http://librex.2356uhnbpv5nk3bni5bv6jg2cd6lgj664kwx3lhyelstpttpyv4kk2qd.onion/) | ❌ | 🇭🇺 HU (OFFICIAL INSTANCE) |
 | [librex.extravi.dev](https://librex.extravi.dev/) | [✅](http://ncblhz7q4sfbf755bdbhebfzxcpypz7ewafgi4agatecojz7pln4i3id.onion/) | [✅](http://rra33hiaf6nmby7jfpqe2gqmng3jnzkvbu2n7jgce7vbhoyuhzya.b32.i2p/) | 🇩🇪 DE |
 | [search.davidovski.xyz](https://search.davidovski.xyz/) | ❌ | ❌ | 🇬🇧 UK |
 | [search.funami.tech](https://search.funami.tech/) | ❌ | ❌ | 🇰🇷 KR |

+ 53 - 0
config.php

@@ -0,0 +1,53 @@
+<?php
+    return (object) array(
+
+        // e.g.: fr -> https://google.fr/
+        "google_domain" => "com",
+
+        // Google results will be in this language
+        "google_language" => "en",
+
+        "disable_bittorent_search" => false,
+        "bittorent_trackers" => "&tr=http%3A%2F%2Fnyaa.tracker.wf%3A7777%2Fannounce&tr=udp%3A%2F%2Fopen.stealth.si%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce",
+
+        /* 
+            Preset privacy friendly frontends for users, these can be overwritten by users in settings
+            e.g.: "invidious" => "https://yewtu.be",
+        */
+        "invidious" => "",
+        "bibliogram" => "",
+        "nitter" => "",
+        "libreddit" => "",
+        "proxitok" => "",
+        "wikiless" => "",
+
+        /*
+            To send requests trough a proxy uncomment CURLOPT_PROXY and CURLOPT_PROXYTYPE:
+
+            CURLOPT_PROXYTYPE options:
+
+                CURLPROXY_HTTP
+                CURLPROXY_SOCKS4
+                CURLPROXY_SOCKS4A
+                CURLPROXY_SOCKS5
+                CURLPROXY_SOCKS5_HOSTNAME
+
+            !!! ONLY CHANGE THE OTHER OPTIONS IF YOU KNOW WHAT YOU ARE DOING !!!
+        */
+        "curl_settings" => array(
+            // CURLOPT_PROXY => "ip:port",
+            // CURLOPT_PROXYTYPE => CURLPROXY_HTTP,
+            CURLOPT_RETURNTRANSFER => true,
+            CURLOPT_ENCODING => "",
+            CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36",
+            CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
+            CURLOPT_CUSTOMREQUEST => "GET",
+            CURLOPT_PROTOCOLS => CURLPROTO_HTTPS | CURLPROTO_HTTP,
+            CURLOPT_REDIR_PROTOCOLS => CURLPROTO_HTTPS | CURLPROTO_HTTP,
+            CURLOPT_MAXREDIRS => 5,
+            CURLOPT_TIMEOUT => 8,
+            CURLOPT_VERBOSE => false
+        )
+
+    );
+?>

+ 2 - 2
engines/qwant/image.php

@@ -28,7 +28,7 @@
 
                     array_push($results, 
                         array (
-                            "thumbnail" => $thumbnail,
+                            "thumbnail" => urldecode(htmlspecialchars($thumbnail)),
                             "alt" => htmlspecialchars($alt),
                             "url" => htmlspecialchars($real_url)
                         )
@@ -46,7 +46,7 @@
 
             foreach($results as $result)
             {
-                $thumbnail = $result["thumbnail"];
+                $thumbnail = urlencode($result["thumbnail"]);
                 $alt = $result["alt"];
                 $url = $result["url"];
 

+ 16 - 3
static/css/styles.css

@@ -41,7 +41,7 @@ a:hover,
 
 .search-container {
     text-align: center;
-    margin-top: 230px;
+    margin-top: 10%;
 }
 
 .search-container h1 {
@@ -130,7 +130,7 @@ a:hover,
 .sub-search-button-wrapper button {
     border: none;
     background-color: inherit;
-    font-size: 14px;
+    font-size: 15px;
     margin-right: 14px;
 }
 
@@ -314,7 +314,7 @@ a:hover,
 }
 
 /* mobile view */
-@media only screen and (max-width: 900px) {
+@media only screen and (max-width: 750px) {
     .search-container input {
         width: 80%;
     }
@@ -325,6 +325,19 @@ a:hover,
         width: 80%;
     }
 
+    .image-result-container {
+        display:unset;
+        margin: 0;
+        padding: 0;
+    }
+
+    .image-result-container img {
+        margin: 0 5% 5% 5%;
+        padding: 0;
+        width: 90%;
+        border: none;
+    }
+
     .git-container {
         display: none;
     }