From fd39efc8e97dabe648e49bcabc108980590c6ae5 Mon Sep 17 00:00:00 2001 From: hnhx Date: Tue, 16 Aug 2022 15:50:44 +0200 Subject: [PATCH] fixed image results on mobile, fixed api url encoding, librex should look better now on small monitors, fixed onion address for beparanoid.de --- README.md | 2 +- config.php | 53 +++++++++++++++++++++++++++++++++++++++++ engines/qwant/image.php | 4 ++-- static/css/styles.css | 19 ++++++++++++--- 4 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 config.php diff --git a/README.md b/README.md index db41c4d..815b9ac 100644 --- a/README.md +++ b/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 | diff --git a/config.php b/config.php new file mode 100644 index 0000000..6c42f62 --- /dev/null +++ b/config.php @@ -0,0 +1,53 @@ + 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 + ) + + ); +?> diff --git a/engines/qwant/image.php b/engines/qwant/image.php index 524393f..d5b7a16 100644 --- a/engines/qwant/image.php +++ b/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"]; diff --git a/static/css/styles.css b/static/css/styles.css index 9e3f82b..358ccc8 100644 --- a/static/css/styles.css +++ b/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; }